/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/purchasing/forecast.aspx
195 строк
7 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="forecast.aspx.vb" Inherits="Common_schedule" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Working schedule and manpower</title> <style> .date { width: 70px; } .center { margin: 0 auto; } body { font-family: Tahoma; } .click { cursor: pointer; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManagerProxy1" runat="server"> <Services> <asp:ServiceReference Path="~/Services/edGrid.svc" /> </Services> <Scripts> <asp:ScriptReference Path="~/Scripts/jquery-1.9.1.min.js" /> </Scripts> </asp:ScriptManager> <div> <table class="center "> <tr> <td>From</td> <td>To</td> <td> </td> <td> </td> </tr> <tr> <td> <asp:TextBox ID="fromDate" runat="server" CssClass="date" AutoPostBack="True"></asp:TextBox> <asp:CalendarExtender ID="from_CalendarExtender" runat="server" Enabled="True" Format="yyyy-MM-dd" TargetControlID="fromDate"> </asp:CalendarExtender> </td> <td> <asp:TextBox ID="toDate" runat="server" CssClass="date" AutoPostBack="True"></asp:TextBox> <asp:CalendarExtender ID="to_CalendarExtender" runat="server" Enabled="True" Format="yyyy-MM-dd" TargetControlID="toDate"> </asp:CalendarExtender> </td> <td> <asp:ImageButton ID="btnRefresh" runat="server" ImageUrl="~/Images/Refresh.png" /> </td> <td> <asp:ImageButton ID="ExcelDownload" runat="server" AlternateText="Excel Download" Height="28px" ImageUrl="~/Images/Microsoft Office 2003 Excel.png" ToolTip="Excel download" Width="28px" /> </td> </tr> <tr> <td colspan="4"> <asp:Label ID="message" runat="server"></asp:Label> </td> </tr> </table> <asp:GridView ID="schedule" runat="server" CssClass="center" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" ShowFooter="True"> <AlternatingRowStyle BackColor="White" /> <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> </div> <script type="text/javascript"> var cell; var savingCell; var txt; var value; var srv = new Services.edGrid(); var category = []; $(document).ready(function () { countTotals(); }); $(document).keyup(function (e) { if (e.keyCode == 27) { if (cell != null) { cell.text(txt); cell.removeClass("noclick"); cell.addClass("click"); cell = null; countTotals(); } } }); $(".click").dblclick(function () { if ($(this).attr("class").indexOf("noclick") < 0) { //Saving data if there is active cell if ((cell != null)) { SaveData(); }; cell = $(this); txt = $(this).text(); cell.removeClass("click") cell.addClass("noclick"); cell.html("<input name=\"foo\" type=\"number\" id=\"foo\" style=\"width: 70px;\" value=\"" + txt + "\">"); $("#foo").focus(); bindSubmit("#foo"); }; }); function countTotals() { $(".click").each(function () { var key = $(this).attr("key").split("|")[1] + "|" + $(this).attr("key").split("|")[2] + "|" + $(this).attr("key").split("|")[3]; if (jQuery.inArray(key, category) != -1) { if ($.isNumeric($(this).text())) { $("body").data(key, $("body").data(key) + parseInt($(this).text())); }; } else { category.push(key); if ($.isNumeric($(this).text())) { $("body").data(key, parseInt($(this).text())); } else { $("body").data(key, 0); }; }; }); $.each(category, function (index, key) { $("td[key|='Total|" + key + "']").text($("body").data(key)); $("body").data(key , 0); }) category = []; }; function bindSubmit(controlName) { $(controlName).bind('keydown', function (e) { if ((e.which == 13) && (e.shiftKey == false)) { e.preventDefault(); SaveData(); return false; } }); $(controlName).bind('change', function (e) { if (cell != null) { cell.addClass("green"); } }); }; function SaveData() { savingCell = cell; srv.InsertOrUpdate(cell.attr("tid"), cell.attr("key"), $("#foo").val(), SaveDataSuccess, SaveDataFail); cell.removeClass("noclick") cell.addClass("click"); cell.html("<img src='../images/uploading.gif' />"); cell = null; }; function SaveDataSuccess(result) { savingCell.text(result); savingCell.removeClass("red"); savingCell.removeClass("green"); savingCell = null; countTotals(); }; function SaveDataFail(result) { //console.log(result); savingCell.text(result); savingCell.addClass("red"); cellsavingCell = null; }; </script> </form> </body> </html>