/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/mm/plan_with_key_materials.aspx
338 строк
12 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="plan_with_key_materials.aspx.vb" Inherits="MM_plan_with_key_materials" %> <%@ Register Src="~/UserControls/alerter.ascx" TagPrefix="uc1" TagName="alerter" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <style type="text/css"> body { font-family: Arial; font-size: 8pt; } table { margin: 0 auto; } .textinput { margin: 0 auto; } .click { text-align: center; font-family: Consolas; background-color: #edecec; cursor: pointer; } .noclick { text-align: center; font-family: Consolas; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; background-color: Yellow; } </style> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Timer ID="Timer1" runat="server" Enabled="False" Interval="10000"> </asp:Timer> <div id="getdatafromgerp" style="text-align: center;"> <asp:TextBox ID="reportDate" TextMode="Date" runat="server"></asp:TextBox> <asp:Button id="getData" runat ="server" Text ="Extract from GERP" /> <asp:Label ID="message" runat ="server"></asp:Label> <uc1:alerter runat="server" ID="alerter" /> </div> <table> <tr> <td> Plan date </td> <td> Line </td> <td> Model </td> <td> Import </td> <td rowspan="2"> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/refresh.png" ToolTip="Refresh data" /> </td> <td rowspan="2"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/Excel.png" Width="27px" Height="27px" ToolTip="ExcelDonwload" /> </td> <td rowspan="2"> <asp:ImageButton ID="ibPrint" runat="server" CssClass="imageButton" ImageUrl="~/Images/buttons/24/print.png" ToolTip="Print report" /> </td> </tr> <tr> <td> <asp:DropDownList ID="ddlPlanDate" runat="server" DataSourceID="sdsPlanDate" DataTextField="plan_date" DataValueField="plan_date" AutoPostBack="True"> </asp:DropDownList> <asp:SqlDataSource ID="sdsPLanDate" runat="server" ConnectionString="<%$ ConnectionStrings:SAPDataConnectionString %>" SelectCommand="SELECT DISTINCT [plan_date] FROM [daily_plan_with_version] ORDER BY [plan_date] DESC"> </asp:SqlDataSource> </td> <td> <asp:DropDownList ID="ddlLine" runat="server" DataSourceID="sdsLine" DataTextField="line" DataValueField="line" AutoPostBack="True" AppendDataBoundItems="True"> </asp:DropDownList> <asp:SqlDataSource ID="sdsLine" runat="server" ConnectionString="<%$ ConnectionStrings:SAPDataConnectionString %>" SelectCommand="SELECT DISTINCT [line] FROM [daily_plan_with_version] WHERE ([plan_date] = @plan_date)"> <SelectParameters> <asp:ControlParameter ControlID="ddlPlanDate" DbType="Date" Name="plan_date" PropertyName="SelectedValue" /> </SelectParameters> </asp:SqlDataSource> </td> <td> <asp:DropDownList ID="ddlModel" runat="server" DataSourceID="sdsModel" DataTextField="model" DataValueField="model" AutoPostBack="True" AppendDataBoundItems="True"> </asp:DropDownList> <asp:SqlDataSource ID="sdsModel" runat="server" ConnectionString="<%$ ConnectionStrings:SAPDataConnectionString %>" SelectCommand="SELECT DISTINCT [model] FROM [daily_plan_with_version] WHERE (([plan_date] = @plan_date) AND ([line] like @line)) ORDER BY [model]"> <SelectParameters> <asp:ControlParameter ControlID="ddlPlanDate" DbType="Date" Name="plan_date" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="ddlLine" Name="line" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:SqlDataSource> </td> <td> <asp:DropDownList ID="ddlVendor" runat="server" AutoPostBack="True"> <asp:ListItem Value="%">ALL</asp:ListItem> <asp:ListItem>Y</asp:ListItem> <asp:ListItem>N</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td colspan='7' style="text-align: center"> <asp:CheckBox ID="chkHighlightPassedPo" runat="server" AutoPostBack="True" Text="Hightlight passed PO" /> <asp:CheckBox ID="chkAutoRefresh" runat="server" AutoPostBack="True" Text="Auto refresh" /> </td> </tr> </table> </div> <div> <asp:GridView ID="GridView1" runat="server" DataSourceID="sdsReport" AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" AllowSorting="True"> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:BoundField DataField="line" HeaderText="Line" SortExpression="line" /> <asp:BoundField DataField="model" HeaderText="Model" SortExpression="model" /> <asp:BoundField DataField="version" HeaderText="Version" SortExpression="version" /> <asp:BoundField DataField="start_time" HeaderText="Start time" SortExpression="start_time" /> <asp:BoundField DataField="order" HeaderText="Order" SortExpression="order" /> <asp:BoundField DataField="qty" HeaderText="Plan qty" SortExpression="qty" /> <asp:BoundField DataField="panel" HeaderText="Panel" SortExpression="panel" > <ItemStyle CssClass="click" /> </asp:BoundField> <asp:BoundField DataField="ip_smps" HeaderText="IP/SMPS" SortExpression="ip_smps" > <ItemStyle CssClass="click" /> </asp:BoundField> <asp:BoundField DataField="speaker" HeaderText="Speaker" SortExpression="speaker" > <ItemStyle CssClass="click" /> </asp:BoundField> <asp:BoundField DataField="stand" HeaderText="Stand" SortExpression="stand" > <ItemStyle CssClass="click" /> </asp:BoundField> <asp:TemplateField HeaderText="Import" SortExpression="v1"> <ItemTemplate> <%--<asp:Image ID="img1" runat="server" ImageUrl ='<%# iif(Eval("v1")="Y","~/Images/SAP/warning.png","") %>' />--%> <asp:Label ID="lbl1" runat="server" Text='<%# iif(Eval("v1")="Y","IMPORT",iif(Eval("v1")="N","LOCAL", "")) %>' BackColor='<%# iif(Eval("v1")="Y",Drawing.Color.Yellow,iif(Eval("v1")="N",Drawing.Color.LightGreen, Drawing.Color.Transparent)) %>' /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> <asp:BoundField DataField="front" HeaderText="Front" SortExpression="front" > <ItemStyle CssClass="click" /> </asp:BoundField> <asp:TemplateField HeaderText="Import" SortExpression="v2"> <ItemTemplate> <%--<asp:Image ID="img1" runat="server" ImageUrl ='<%# iif(Eval("v2")="Y","~/Images/SAP/warning.png","") %>' />--%> <asp:Label ID="lbl2" runat="server" Text='<%# iif(Eval("v2")="Y","IMPORT",iif(Eval("v2")="N","LOCAL", "")) %>' BackColor='<%# iif(Eval("v2")="Y",Drawing.Color.Yellow,iif(Eval("v2")="N",Drawing.Color.LightGreen, Drawing.Color.Transparent)) %>' /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> <asp:BoundField DataField="rear" HeaderText="Rear" SortExpression="rear" > <ItemStyle CssClass="click" /> </asp:BoundField> <asp:TemplateField HeaderText="Import" SortExpression="v3"> <ItemTemplate> <%--<asp:Image ID="img1" runat="server" ImageUrl ='<%# iif(Eval("v3")="Y","~/Images/SAP/warning.png","") %>' />--%> <asp:Label ID="lbl3" runat="server" Text='<%# iif(Eval("v3")="Y","IMPORT",iif(Eval("v3")="N","LOCAL", "")) %>' BackColor='<%# iif(Eval("v3")="Y",Drawing.Color.Yellow,iif(Eval("v3")="N",Drawing.Color.LightGreen, Drawing.Color.Transparent)) %>' /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> </Columns> <FooterStyle BackColor="#CCCC99" /> <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" /> <RowStyle BackColor="#F7F7DE" /> <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /> <SortedAscendingCellStyle BackColor="#FBFBF2" /> <SortedAscendingHeaderStyle BackColor="#848384" /> <SortedDescendingCellStyle BackColor="#EAEAD3" /> <SortedDescendingHeaderStyle BackColor="#575357" /> </asp:GridView> <asp:SqlDataSource ID="sdsReport" runat="server" ConnectionString="<%$ ConnectionStrings:SAPDataConnectionString %>" SelectCommand="select line, model, version, start_time, [order] , qty, panel, ip_smps, speaker, stand, case when stand ='' then '' else v1 end as v1, front, case when front ='' then '' else v2 end as v2, rear, case when rear ='' then '' else v3 end as v3 from ( select t1.line, t1.model, t1.version, t1.start_time, t1.po as 'order', t1.qty, case t2.panel WHEN '' THEN case t2.lcm_assy WHEN '' THEN t2.product_lcd else t2.lcm_assy end else t2.panel end as panel, t2.ip_smps, t2.speaker, t2.stand, isnull(t2.stand_IMPORT,'N') as v1, t2.stand_mrpc_gerp as stand_GERP_MRP, case t2.front when '' then t2.assy_cover_pmiddle else t2.front end as front, isnull( case t2.front when '' then t2.pmiddle_IMPORT else t2.front_IMPORT end,'N') as v2, case t2.front when '' then t2.pmiddle_mrpc_gerp else t2.front_mrpc_gerp end as front_GERP_MRP, case t2.rear when '' then t2.rear else t2.rear end as rear, isnull( case t2.rear when '' then t2.rear_IMPORT else t2.rear_IMPORT end,'N') as v3, case t2.rear when '' then t2.rear_mrpc_gerp else t2.rear_mrpc_gerp end as rear_GERP_MRP from daily_plan_with_version t1 left join key_material_with_mrpc t2 on t1.model = t2.model and t1.version = t2.version where t1.plan_date = @plan_date and t1.line like @line and t1.model like @model ) ttt where isnull(ttt.v1,'') like @vendor or isnull(ttt.v2,'') like @vendor or isnull(ttt.v3,'') like @vendor order by line, start_time"> <SelectParameters> <asp:ControlParameter ControlID="ddlPlanDate" DefaultValue="%" Name="plan_date" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="ddlLine" DefaultValue="%" Name="line" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="ddlModel" DefaultValue="%" Name="model" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="ddlVendor" DefaultValue="%" Name="vendor" PropertyName="SelectedValue" /> </SelectParameters> </asp:SqlDataSource> </div> <script type ="text/javascript"> var cell; var txt; var value; $(document).keyup(function (e) { if (e.keyCode == 27) { if (cell != null) { cell.text(txt); cell.removeClass("noclick"); cell.addClass("click"); } } }); $(".click").dblclick(function () { if (cell != null) { cell.text(value); cell.removeClass("noclick") cell.addClass("click"); }; cell = $(this); txt = $(this).text(); value = $(this).text(); $.ajax({ url: "../Handlers/getcontrol.ashx", data: "field=" + $(this).attr("field") + "&model=" + $(this).attr("model") + "&version=" + $(this).attr("version") + "&data=" + $(this).text(), success: function (data) { cell.html(data); cell.removeClass("click"); cell.addClass("noclick"); $("#foo").focus(); $("#foo").bind('keydown', function (e) { if (e.which == 13) { value = $(this).val(); $.ajax({ url: "../Handlers/savedata.ashx", data: "field=" + $(this).attr("field") + "&model=" + $(this).attr("model") + "&version=" + $(this).attr("version") + "&data=" + $(this).val(), success: function (data) { if (data == "OK") { if (cell != null) { cell.text(value); cell.removeClass("noclick"); cell.addClass("click"); }; } else { cell.text(data); value = txt; }; } }); e.preventDefault(); return false; } }); } }); }); </script> </form> </body> </html>