コード例 #1
0
        protected void btnAction_Click(object sender, EventArgs e)
        {
            lblNotif.Text = String.Empty;
            foreach (var items in lvAllTickets.Items)
            {
                var chkBoxRows = (CheckBox)items.FindControl("cbSelect");

                if (chkBoxRows.Checked)
                {
                    var id     = (HiddenField)items.FindControl("hfID");
                    var ticket = new DAL.DataBaseObjects.Tickets {
                        ID = Convert.ToInt32(id.Value)
                    };
                    ticket.GetById();

                    var issuance = new IssuanceLists()
                    {
                        ID = Convert.ToInt32(ddlIssuanceLists.SelectedValue)
                    };
                    issuance.GetById();

                    //присваиваем заявке расчетный лист только если ее юсерАйДИ совпадает с АйДи из расчетного лисна или если убираем расчетный лист с заявки
                    if (ticket.UserID == issuance.UserID || ddlIssuanceLists.SelectedValue == "0")
                    {
                        ticket.IssuanceListID = Convert.ToInt32(ddlIssuanceLists.SelectedValue);
                        ticket.Update();
                    }
                }
            }
        }
コード例 #2
0
        public void bntCreate_Click(Object sender, EventArgs e)
        {
            var id   = Page.Request.Params["id"];
            var user = new Users()
            {
                ID = Convert.ToInt32(tbUID.Text)
            };

            user.GetById();
            if (String.IsNullOrEmpty(user.Name))
            {
                lblError.Text = "Пользователя с таким UID не существует!";
                return;
            }

            var issuancelists = new IssuanceLists()
            {
                Comment               = tbComment.Text,
                IssuanceDate          = Convert.ToDateTime(tbIssuanceDate.Text),
                UserID                = Convert.ToInt32(tbUID.Text),
                IssuanceListsStatusID = 1
            };

            if (id == null)
            {
                issuancelists.Create();
            }
            else
            {
                issuancelists.ID = Convert.ToInt32(id);
                issuancelists.Update();
            }
            Page.Response.Redirect("~/ManagerUI/Menu/Issuance/IssuanceListsView.aspx");
        }
コード例 #3
0
 public string WantPayment(string userid, string appkey)
 {
     if (appkey != Globals.Settings.AppServiceSecureKey)
     {
         return("invalid app key");
     }
     try
     {
         var          emails = BackendHelper.TagToValue("want_payment_address").Split(new[] { ',' });
         const string title  = "Поступил новый запрос на расчет";
         var          user   = new Users {
             ID = Convert.ToInt32(userid)
         };
         user.GetById();
         var body = String.Format("От клиента #{0} ({1} {2}, {3})", user.ID, user.Name, user.Family, user.Phone);
         EmailMethods.MailSend(title, body, emails); //отправка емейла кассирам
         var issuancelist = new IssuanceLists()
         {
             UserID = user.ID,
             IssuanceListsStatusID = 1,
             Comment = String.Format("Для клиента #{0} ({1} {2}, {3})", user.ID, user.Name, user.Family, user.Phone)
         };
         string result;
         if (DateTime.Now.Hour < 13)
         {
             issuancelist.IssuanceDate = DateTime.Now;
             result = "ok-now";
         }
         else
         {
             issuancelist.IssuanceDate = DateTime.Now.AddDays(1);
             result = "ok-tommorow";
         }
         issuancelist.Create();
         const string titleForUser = "******";
         var          titleForBody = "Для улучшения качества обслуживания по своевременному расчету по Вашим заявкам, " +
                                     "ввиду: погодных условий, несвоевременной явки клиентов и создания очередей, с 14.01 по 31.01.2016 года" +
                                     " внесены изменения в графике работы бухгалтерии: <br/>" +
                                     "• Заявки, оформленные до 13.00 – расчет на завтра;<br/>" +
                                     "• Заявки, оформленные после 13.00 – расчет на послезавтра;<br/>" +
                                     "В связи с этими изменениями ваша заявка на расчет будет обработана";
         if (result == "ok-tommorow")
         {
             titleForBody += " послезавтра, либо в ближайший рабочий день";
         }
         else
         {
             titleForBody += " завтра, либо в ближайший рабочий день";
         }
         EmailMethods.MailSendHTML(titleForUser, titleForBody, user.Email); //отправка емейла пользователю
         return(result);
     }
     catch (Exception)
     {
         return("invalid data");
     }
 }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerIssuanceListViewTitle.Replace("{0}", Page.Request.Params["id"]) + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlIssuance", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlIssuanceListsView", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageIssuanceListView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (currentRole.ActionIssuanceListDelete != 1)
            {
                btnDelete.Visible = false;
            }

            if (!String.IsNullOrEmpty(Page.Request.Params["id"]))
            {
                var issuanceList = new IssuanceLists()
                {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                issuanceList.GetById();
                if (issuanceList.IssuanceListsStatusID == 3 || issuanceList.IssuanceListsStatusID == 1)
                {
                    btnReopen.Visible = false;
                    btnClose.Visible  = true;
                }
                else
                {
                    btnReopen.Visible = true;
                    btnClose.Visible  = false;
                }
                var user = UsersHelper.UserIDToFullName(issuanceList.UserID.ToString());
                lblListInfo.Text = String.Format("# {0}, {1}, рассчет: {2}", issuanceList.ID, user,
                                                 OtherMethods.DateConvert(issuanceList.IssuanceDate.ToString()));
            }
            else
            {
                pnlSearschResult.Visible = pnlResultPanel.Visible = btnAction.Visible = false;
                lblPage.Visible          = false;
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Page.Request.Params["id"]))
            {
                Page.Title = PagesTitles.ManagerIssuanceListsEditTitle.Replace("{0}", Page.Request.Params["id"]) + BackendHelper.TagToValue("page_title_part");
            }
            else
            {
                Page.Title = PagesTitles.ManagerIssuanceListsCreateTitle + BackendHelper.TagToValue("page_title_part");
            }
            OtherMethods.ActiveRightMenuStyleChanche("hlIssuance", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlIssuanceListsEdit", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageIssuanceListsEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (Page.Request.Params["id"] != null)
            {
                var issuancelists = new IssuanceLists()
                {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                issuancelists.GetById();
                if (!IsPostBack)
                {
                    tbComment.Text      = issuancelists.Comment;
                    tbIssuanceDate.Text = Convert.ToDateTime(issuancelists.IssuanceDate).ToString("dd-MM-yyyy");
                    tbUID.Text          = issuancelists.UserID.ToString();
                }
                lblIssuanceList.Text = "Редактирование рассчетного листа";
            }
        }
コード例 #6
0
        public static bool CloseIssuanceList(Int32 issuanceListId)
        {
            var isAllTicketsChanged = true;
            var user           = (Users)HttpContext.Current.Session["userinsession"];
            var rolesList      = HttpContext.Current.Application["RolesList"] as List <Roles>;
            var currentRole    = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == user.Role.ToLower());
            var currentTickets = new Tickets {
                IssuanceListID = issuanceListId
            };
            var ds = currentTickets.GetAllItems("ID", "ASC", "IssuanceListID");

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                var currentTicket = new Tickets {
                    ID = Convert.ToInt32(row["ID"])
                };
                currentTicket.GetById();
                var updateTicket = new Tickets {
                    ID = Convert.ToInt32(row["ID"])
                };
                var statusError = TicketsFilter.StatusChangeFilter(ref updateTicket, currentTicket.DriverID.ToString(), currentTicket.StatusID.ToString(), currentTicket.StatusDescription, currentTicket.AdmissionDate.ToString(), null, "6", null, currentRole);
                if (statusError != null && isAllTicketsChanged == true)
                {
                    isAllTicketsChanged = false;
                }
                updateTicket.Update(user.ID, OtherMethods.GetIPAddress(), "IssuanceListsView");
            }
            var issuanceList = new IssuanceLists {
                ID = issuanceListId
            };

            issuanceList.GetById();
            issuanceList.IssuanceListsStatusID = 2;
            issuanceList.Update();
            return(isAllTicketsChanged);
        }
コード例 #7
0
        public static void DeleteIssuanceList(Int32 issuanceListId)
        {
            var issuanceList = new IssuanceLists();

            issuanceList.Delete(issuanceListId);
        }