Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DialogUtils.SetScriptSubmit(this);

            ClientScript.RegisterHiddenField("resd", "");


            perso = sc.UserAction(User.Identity.Name, Restrictions.Perso);

            branch_current     = sc.BranchId(User.Identity.Name);
            branch_main_filial = BranchStore.getBranchMainFilial(branch_current, perso);

            if (sc.UserAction(User.Identity.Name, Restrictions.AllData))
            {
                branchSearch = " (1=1) ";
            }
            else
            {
                branchSearch = String.Format(" (id_branchCard={0} or id_branchCard in (select id from Branchs where id_parent={0} or id_parentTr={0}))", sc.BranchId(User.Identity.Name));
            }
            if (!sc.UserAction(User.Identity.Name, Restrictions.CardsView))
            {
                Response.Redirect("~\\Account\\Restricted.aspx", true);
            }



            if (IsPostBack)
            {
                return;
            }

            lock (Database.lockObjectDB)
            {
                gvCard.PageSize = 50;

                // Решили оставить страницу с картами певоначально пустой
                lbSearch.Text = "where 1=0";

                //if (ServiceClass.UserAction(User.Identity.Name, Restrictions.Filial))
                //    lbSearch.Text = " where id_stat=4 ";
                //else
                //    lbSearch.Text = " where id_stat=2 ";
                lbSort.Text = "order by dateProd desc,DepBranchCard,company,fio";
                Refr(true);
            }
            if (!sc.UserAction(User.Identity.Name, Restrictions.CardsDelete))
            {
                bDeleteCards.Visible = false;
            }
            if (!sc.UserAction(User.Identity.Name, Restrictions.CardsGive))
            {
                bFilCards.Visible = false;
            }
            GC.Collect();

            Session["Card"] = this;
        }
Exemplo n.º 2
0
        private void SetButton()
        {
            ServiceClass sc = new ServiceClass();

            if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
            {
                bNew.Visible    = false;
                bEdit.Visible   = false;
                bDelete.Visible = false;
                bExcel.Visible  = false;
                return;
            }

            if (gvManufacturers.Rows.Count > 0)
            {
                bEdit.Visible   = true;
                bDelete.Visible = true;
                bExcel.Visible  = true;

                bDelete.Attributes.Add("OnClick", String.Format("return confirm('Удалить производителя {0}?');", gvManufacturers.DataKeys[Convert.ToInt32(gvManufacturers.SelectedIndex)].Values["name"].ToString()));
                bEdit.Attributes.Add("OnClick", String.Format("return show_catalog('type=manufacturer&mode=2&id={0}')", gvManufacturers.DataKeys[Convert.ToInt32(gvManufacturers.SelectedIndex)].Values["id"].ToString()));
            }
            else
            {
                bEdit.Visible   = false;
                bDelete.Visible = false;
                bExcel.Visible  = false;
            }
        }
Exemplo n.º 3
0
        private void SetButton()
        {
            if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
            {
                bNew.Visible    = false;
                bEdit.Visible   = false;
                bDelete.Visible = false;
                bExcel.Visible  = false;
                return;
            }
            if (gvCouriers.Rows.Count > 0)
            {
                bEdit.Visible   = true;
                bDelete.Visible = true;
                bExcel.Visible  = true;

                bDelete.Attributes.Add("OnClick", String.Format("return confirm('Удалить курьерскую службу {0}?');", gvCouriers.DataKeys[Convert.ToInt32(gvCouriers.SelectedIndex)].Values["name"].ToString()));
                bEdit.Attributes.Add("OnClick", String.Format("return show_catalog('type=courier&mode=2&id={0}')", gvCouriers.DataKeys[Convert.ToInt32(gvCouriers.SelectedIndex)].Values["id"].ToString()));
            }
            else
            {
                bEdit.Visible   = false;
                bDelete.Visible = false;
                bExcel.Visible  = false;
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
            {
                Response.Redirect("~\\Account\\Restricted.aspx", true);
            }

            if (IsPostBack)
            {
                return;
            }
            if (FuncClass.ClientType != ClientType.AkBars)
            {
                pAkBarsProperties.Visible = false;
            }



            lock (Database.lockObjectDB)
            {
                if (Request.QueryString["mode"] == "2")
                {
                    ZapFields();
                }
                else
                {
                    cbIsolated.Visible = true;
                }
                tbKodBank.Focus();
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                //alldata = sc.UserAction(User.Identity.Name, Restrictions.FilialDeliver);
                current_branch_id = sc.BranchId(User.Identity.Name);
                //if (current_branch_id == 106) alldata = true;
                //else alldata = false;
                int branchIdMain = BranchStore.getBranchMainFilial(current_branch_id, false);
                if (branchIdMain > 0 && branchIdMain == current_branch_id)
                {
                    alldata = true;
                }
                else
                {
                    alldata = false;
                }
                dListStatus.AutoPostBack = alldata;

                branch_main_filial = BranchStore.getBranchMainFilial(current_branch_id, sc.UserAction(User.Identity.Name, Restrictions.Perso));

                if (FIO_state.Trim().Length > 0)
                {
                    tbFio.Text = FIO_state;
                }

                if (!IsPostBack)
                {
                    ZapCombo();
                    tbNumber.Focus();
                }
            }
        }
Exemplo n.º 6
0
        private void SetButton()
        {
            lbInform.Text = "";
            ServiceClass sc = new ServiceClass();

            if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
            {
                bNew.Visible    = false;
                bEdit.Visible   = false;
                bDelete.Visible = false;
                bExcel.Visible  = false;
                return;
            }

            if (gvAttachments.Rows.Count > 0)
            {
                bEdit.Visible   = true;
                bDelete.Visible = true;
                bExcel.Visible  = true;

                bDelete.Attributes.Add("OnClick", String.Format("return confirm('Удалить вложение {0}?');", gvAttachments.DataKeys[Convert.ToInt32(gvAttachments.SelectedIndex)].Values["prod_name_at"].ToString()));
                bEdit.Attributes.Add("OnClick", String.Format("return show_productatt('mode=2&id_pa={0}&id_prb={1}')", gvAttachments.DataKeys[Convert.ToInt32(gvAttachments.SelectedIndex)].Values["id_pa"].ToString(), gvAttachments.DataKeys[Convert.ToInt32(gvAttachments.SelectedIndex)].Values["id_prb_p"].ToString()));
            }
            else
            {
                bEdit.Visible   = false;
                bDelete.Visible = false;
                bExcel.Visible  = false;
            }
        }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lock (Database.lockObjectDB)
     {
         ServiceClass sc = new ServiceClass();
         if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryOrgEdit))
         {
             Response.Redirect("~\\Account\\Restricted.aspx", true);
         }
         org_id = Convert.ToInt32(Request.QueryString["idO"]);
         p_id   = Convert.ToInt32(Request.QueryString["idP"]);
         mode   = Convert.ToInt32(Request.QueryString["mode"]);
         Title  = (mode == 1) ? "Добавление сотрудника организации" : "Редактирование сотрудника организации";
         if (Page.IsPostBack)
         {
             return;
         }
         if (mode == 1)
         {
             DataSet ds = new DataSet();
             Database.ExecuteQuery("select title,embosstitle from org where id=" + org_id.ToString(), ref ds, null);
             if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
             {
                 tbTitle.Text  = Convert.ToString(ds.Tables[0].Rows[0]["Title"]).Trim();
                 tbEmboss.Text = Convert.ToString(ds.Tables[0].Rows[0]["EmbossTitle"]).Trim();
             }
         }
         if (mode == 2)
         {
             LoadOrg();
         }
     }
 }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                ClientScript.RegisterHiddenField("resd", "");
                if (!sc.UserAction(User.Identity.Name, Restrictions.PurchaseView))
                {
                    Response.Redirect("~\\Account\\Restricted.aspx", true);
                }

                if (!IsPostBack)
                {
                    lbInform.Text = "";
                    Refr(0, true);
                }
            }
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Accountable = SingleQuery.IsAccountable(User.Identity.Name);
            lock (Database.lockObjectDB)
            {
                Filial             = sc.UserAction(User.Identity.Name, Restrictions.Filial);
                Perso              = sc.UserAction(User.Identity.Name, Restrictions.Perso);
                FilialDeliver      = sc.UserAction(User.Identity.Name, Restrictions.FilialDeliver);
                current_branch     = sc.BranchId(User.Identity.Name);
                branch_main_filial = BranchStore.getBranchMainFilial(current_branch, Perso);

                if (!IsPostBack)
                {
                    ZapCombo();
                    tbProd.Focus();
                }
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            isAccountBranchView = sc.UserAction(User.Identity.Name, Restrictions.AccountBranchView);

            if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryView) && isAccountBranchView == false)
            {
                Response.Redirect("~\\Account\\Restricted.aspx", true);
            }
            ClientScript.RegisterHiddenField("resd", "");
            if (FuncClass.ClientType != ClientType.AkBars)
            {
                isAccountBranchView = false;
                isAccountBranchEdit = false;
            }

            perso          = sc.UserAction(User.Identity.Name, Restrictions.Perso);
            branch_current = sc.BranchId(User.Identity.Name);

            branch_main_filial = BranchStore.getBranchMainFilial(branch_current, perso);

            isAccountBranchEdit = sc.UserAction(User.Identity.Name, Restrictions.AccountBranchEdit);

            if (isAccountBranchView == false)
            {
                isAccountBranchEdit = false;
            }

            lbInform.Text = "";

            oprdaystart = operDayStart.ClientID;
            oprdayend   = operDayEnd.ClientID;

            if (IsPostBack)
            {
                return;
            }

            lock (Database.lockObjectDB)
            {
                lbInform.Text = "";
                Refr(0);
            }
            raschet = "";
        }
Exemplo n.º 11
0
        private void SetButton()
        {
            lbInform.Text = "";
            if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
            {
                bNew.Visible        = false;
                bEdit.Visible       = false;
                bDelete.Visible     = false;
                bExcel.Visible      = false;
                bDelBank.Visible    = false;
                bAddBank.Visible    = false;
                bLinkProd.Visible   = false;
                bUnlinkProd.Visible = false;
                bSortUp.Visible     = false;
                bSortDown.Visible   = false;
                return;
            }


            if (gvProducts.Rows.Count > 0)
            {
                bEdit.Visible    = true;
                bDelete.Visible  = true;
                bExcel.Visible   = true;
                bDelBank.Visible = true;
                bAddBank.Visible = true;

                bDelete.Attributes.Add("OnClick", String.Format("return confirm('Удалить продукт {0}?');", gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["prod_name_h"].ToString()));
                bDelBank.Attributes.Add("OnClick", String.Format("return confirm('Отвязать банк {0} от продукта {1}?');", gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["bank_name"].ToString(), gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["prod_name_h"].ToString()));
                bEdit.Attributes.Add("OnClick", String.Format("return show_product('mode=2&id_prb={0}&id_prod={1}')", gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["id_prb"].ToString(), gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["id_prod"].ToString()));
                bAddBank.Attributes.Add("OnClick", String.Format("return show_product('mode=3&id_prb=0&id_prod={0}')", gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["id_prod"].ToString()));
                if (gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["parent"] != DBNull.Value && Convert.ToInt32(gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["parent"]) > 0)
                {
                    bUnlinkProd.Visible = true;
                    bLinkProd.Visible   = false;
                }
                else
                {
                    bLinkProd.Visible = true;
                    bLinkProd.Attributes.Add("OnClick", String.Format("return show_product_link('id={0}')", gvProducts.DataKeys[Convert.ToInt32(gvProducts.SelectedIndex)].Values["id_prod"].ToString()));
                    bUnlinkProd.Visible = false;
                }
            }
            else
            {
                bEdit.Visible       = false;
                bDelete.Visible     = false;
                bExcel.Visible      = false;
                bDelBank.Visible    = false;
                bAddBank.Visible    = false;
                bLinkProd.Visible   = false;
                bUnlinkProd.Visible = false;
            }
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryOrgEdit))
                {
                    Response.Redirect("~\\Account\\Restricted.aspx", true);
                }
                ClientScript.RegisterHiddenField("resd", "");

                perso              = sc.UserAction(User.Identity.Name, Restrictions.Perso);
                current_branch     = sc.BranchId(User.Identity.Name);
                branch_main_filial = BranchStore.getBranchMainFilial(current_branch, perso);

                if (!IsPostBack)
                {
                    lbInform.Text = "";
                    Refr(0);
                }
            }
        }
Exemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lock (Database.lockObjectDB)
     {
         perso              = sc.UserAction(User.Identity.Name, Restrictions.Perso);
         branch_current     = sc.BranchId(User.Identity.Name);
         branch_main_filial = BranchStore.getBranchMainFilial(branch_current, perso);
         if (!IsPostBack)
         {
             ZapCombo();
         }
     }
 }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryOrgEdit))
                {
                    Response.Redirect("~\\Account\\Restricted.aspx", true);
                }

                perso              = sc.UserAction(User.Identity.Name, Restrictions.Perso);
                current_branch     = sc.BranchId(User.Identity.Name);
                branch_main_filial = BranchStore.getBranchMainFilial(current_branch, perso);

                if (!IsPostBack)
                {
                    if (Request.QueryString["mode"] == "2")
                    {
                        ZapFields();
                    }
                    tbName.Focus();
                }
            }
        }
Exemplo n.º 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lock (Database.lockObjectDB)
     {
         if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
         {
             Response.Redirect("~\\Account\\Restricted.aspx", true);
         }
         if (!IsPostBack)
         {
             if (Request.QueryString["mode"] == "2")
             {
                 ZapFields();
             }
             tbName.Focus();
         }
     }
 }
Exemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                ServiceClass sc = new ServiceClass();
                if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
                {
                    Response.Redirect("~\\Account\\Restricted.aspx", true);
                }

                mode    = Convert.ToInt32(Request.QueryString["mode"]);
                id_prod = Convert.ToInt32(Request.QueryString["id_prod"]);
                id_prb  = Convert.ToInt32(Request.QueryString["id_prb"]);

                if (mode == 1)
                {
                    Title = "Добавление продукта";
                }
                if (mode == 2)
                {
                    Title = "Редактирование";
                }
                if (mode == 3)
                {
                    Title = "Привязка банка";
                }

                if (!IsPostBack)
                {
                    ZapCombo();
                    if (mode == 2 || mode == 3)
                    {
                        ZapFields();
                    }
                    if (mode == 3)
                    {
                        pProduct.Enabled = false;
                    }
                }
            }
        }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                mode    = Convert.ToInt32(Request.QueryString["mode"]);
                id_doc  = Convert.ToInt32(Request.QueryString["id_doc"]);
                id_type = Convert.ToInt32(Request.QueryString["type_doc"]);
                id_prod = Convert.ToInt32(Request.QueryString["id_prod"]);

                if (mode == 1)
                {
                    Title = "Добавление";
                }
                else
                {
                    Title = "Редактирование";
                }

                if (IsPostBack)
                {
                    return;
                }
                ServiceClass sc = new ServiceClass();
                if (id_type == 6 && sc.UserAction(User.Identity.Name, Restrictions.Filial))
                {
                    tbCnt_New.Enabled   = false;
                    tbCnt_Perso.Enabled = false;
                }
                if (id_type == 14 || id_type == 15) //расходники; на рекламные цели
                {
                    tbCnt_Brak.Enabled  = false;
                    tbCnt_Perso.Enabled = false;
                }
                RefrProduct();
                if (mode == 2)
                {
                    ZapFields();
                }
                BlockCnt();
            }
        }
Exemplo n.º 18
0
        private void SetButton()
        {
            lbInform.Text = "";
            ServiceClass sc = new ServiceClass();

            if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryEdit))
            {
                bNew.Visible       = false;
                bEdit.Visible      = false;
                bDelete.Visible    = false;
                bExcel.Visible     = false;
                bDelFilial.Visible = false;
                bAddFilial.Visible = false;
                return;
            }

            if (gvDelivers.Rows.Count > 0)
            {
                bEdit.Visible   = true;
                bDelete.Visible = (gvDelivers.DataKeys[gvDelivers.SelectedIndex].Values["deliver"].ToString() != "");
                //bDelete.Visible = true;
                bExcel.Visible     = true;
                bDelFilial.Visible = true;
                bAddFilial.Visible = true;

                bDelete.Attributes.Add("OnClick", String.Format("return confirm('Удалить рассылку {0}?');", gvDelivers.DataKeys[Convert.ToInt32(gvDelivers.SelectedIndex)].Values["deliver_h"].ToString()));
                bDelFilial.Attributes.Add("OnClick", String.Format("return confirm('Отвязать филиал {0} от рассылки {1}?');", gvDelivers.DataKeys[Convert.ToInt32(gvDelivers.SelectedIndex)].Values["branch"].ToString(), gvDelivers.DataKeys[Convert.ToInt32(gvDelivers.SelectedIndex)].Values["deliver_h"].ToString()));
                bEdit.Attributes.Add("OnClick", String.Format("return show_listdeliver('mode=2&id_db={0}&id_deliv={1}')", gvDelivers.DataKeys[Convert.ToInt32(gvDelivers.SelectedIndex)].Values["id_db"].ToString(), gvDelivers.DataKeys[Convert.ToInt32(gvDelivers.SelectedIndex)].Values["id_deliv"].ToString()));
                bAddFilial.Attributes.Add("OnClick", String.Format("return show_listdeliver('mode=3&id_db=0&id_deliv={0}')", gvDelivers.DataKeys[Convert.ToInt32(gvDelivers.SelectedIndex)].Values["id_deliv"].ToString()));
            }
            else
            {
                bEdit.Visible      = false;
                bDelete.Visible    = false;
                bExcel.Visible     = false;
                bDelFilial.Visible = false;
                bAddFilial.Visible = false;
            }
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                perso              = sc.UserAction(User.Identity.Name, Restrictions.Perso);
                current_branch     = sc.BranchId(User.Identity.Name);
                branch_main_filial = BranchStore.getBranchMainFilial(current_branch, perso);

                /*
                 * if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryOrgEdit)
                 *                  && branch_main_filial != 106) // Костыль для казанского филиала!!!
                 * Response.Redirect("~\\Account\\Restricted.aspx", true);
                 */

                if (!IsPostBack)
                {
                    SqlCommand comm = new SqlCommand();
                    //comm.CommandText = String.Format("select idP, person from V_Org where embosstitle='{0}'", Request.QueryString["etitle"].ToString());
                    if (branch_main_filial > 0)
                    {
                        comm.CommandText = String.Format("select idP, person from V_Org where embosstitle='{0}' and BranchMainFilialId={1}", Request.QueryString["etitle"].ToString(), branch_main_filial);
                    }
                    else
                    {
                        comm.CommandText = String.Format("select idP, person from V_Org where embosstitle='{0}' and BranchMainFilialId is null", Request.QueryString["etitle"].ToString());
                    }

                    DataSet ds = new DataSet();
                    Database.ExecuteCommand(comm, ref ds, null);
                    rblList.DataTextField  = "Person";
                    rblList.DataValueField = "idP";
                    rblList.DataSource     = ds.Tables[0];
                    rblList.DataBind();
                    rblList.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!sc.UserAction(User.Identity.Name, Restrictions.LibraryPodotchet))
     {
         Response.Redirect("~\\Account\\Restricted.aspx", true);
     }
     db = new CommonDataBase(null);
     if (!IsPostBack)
     {
         RefreshList(0);
         if (gvAccountablePersons.Rows.Count > 0)
         {
             try
             {
                 selectID();
             }
             catch (Exception e1)
             {
                 ClientScript.RegisterClientScriptBlock(GetType(), "bPage_Load", "<script type='text/javascript'>$(document).ready(function(){ " +
                                                        "ShowError('" + System.Security.SecurityElement.Escape(e1.Message) + "'); });</script>");
             }
         }
     }
 }
Exemplo n.º 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!sc.UserAction(Page.User.Identity.Name, Restrictions.LibraryView) &&
         !sc.UserAction(Page.User.Identity.Name, Restrictions.LibraryOrgEdit) &&
         !sc.UserAction(Page.User.Identity.Name, Restrictions.AccountBranchView))
     {
         Response.Redirect("~\\Account\\Restricted.aspx", true);
     }
     if (sc.UserAction(Page.User.Identity.Name, Restrictions.LibraryView))
     {
         CatalogMenu.Items.Add(new MenuItem("Банки", "", "", "~//Bank.aspx"));
         CatalogMenu.Items.Add(new MenuItem("Подразделения", "", "", "~//Branch.aspx"));
         CatalogMenu.Items.Add(new MenuItem("Поставщики", "", "", "~//Supplier.aspx"));
         CatalogMenu.Items.Add(new MenuItem("Производители", "", "", "~//Manufacturer.aspx"));
         CatalogMenu.Items.Add(new MenuItem("Продукция", "", "", "~//Product.aspx"));
         CatalogMenu.Items.Add(new MenuItem("Списки вложений", "", "", "~//ProductAtt.aspx"));
         CatalogMenu.Items.Add(new MenuItem("Курьерские службы", "", "", "~//Courier.aspx"));
         CatalogMenu.Items.Add(new MenuItem("Список рассылок", "", "", "~//ListDeliver.aspx"));
         //CatalogMenu.Items.Add(new MenuItem("Расходные материалы", "", "", "~//Expendables.aspx"));
     }
     else
     {
         if (sc.UserAction(Page.User.Identity.Name, Restrictions.AccountBranchView))
         {
             CatalogMenu.Items.Add(new MenuItem("Подразделения", "", "", "~//Branch.aspx"));
         }
     }
     if (sc.UserAction(Page.User.Identity.Name, Restrictions.LibraryOrgEdit))
     {
         CatalogMenu.Items.Add(new MenuItem("Организации", "", "", "~//Organization.aspx"));
     }
     if (sc.UserAction(Page.User.Identity.Name, Restrictions.LibraryPodotchet))
     {
         CatalogMenu.Items.Add(new MenuItem("Подотчетные лица", "", "", "~//AccountablePerson.aspx"));
     }
 }
Exemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            superusername = "******";
            try
            {
                string str = ConfigurationManager.AppSettings["ClientType"];
                if (str.ToLower() == "uzcard")
                {
                    superusername = "******";
                }
            }
            catch
            {
            }


            if (!sc.UserAction(User.Identity.Name, Restrictions.StorageView) && !sc.UserAction(User.Identity.Name, Restrictions.StorageFilial))
            {
                Response.Redirect("~\\Account\\Restricted.aspx", true);
            }

            ClientScript.RegisterHiddenField("resd", "");


            current_branch_id  = sc.BranchId(User.Identity.Name);
            branch_main_filial = BranchStore.getBranchMainFilial(current_branch_id, sc.UserAction(User.Identity.Name, Restrictions.Perso));
            //showChild.Visible = current_branch_id==106;
            branchIdMain      = BranchStore.getBranchMainFilial(current_branch_id, false);
            showChild.Visible = current_branch_id == branchIdMain;

            lock (Database.lockObjectDB)
            {
                if (!IsPostBack)
                {
                    lbSort.Text = "order by id_type,id_sort";
                    Refr(true);
                }
            }
            GC.Collect();
        }
Exemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Header.DataBind();

            /*
             * MovingStockSection mvConfiguration = (MovingStockSection)ConfigurationManager.GetSection("movingstock");
             * foreach (FieldElement field in mvConfiguration.Fields)
             * {
             *  Response.Write(string.Format("Продукт: {0}<BR>", field.Product));
             *  foreach (ColumnElement column in field.Columns)
             *  {
             *      Response.Write(string.Format("{0}, {1}, {2}, {3}<BR>", column.Nums, column.Debet, column.Credit, column.Ground));
             *  }
             * }
             */
            /*SmsInfoSection smss = (SmsInfoSection) ConfigurationManager.GetSection("sms_info");
             * Response.Write($"company: {smss.SmsInfo.CompanyField}<BR>");
             * foreach (SmsInfoElement sms in smss.SmsInfo)
             * {
             *  Response.Write($"bin: {sms.Bin}, code: {sms.Code}, name: {sms.ShortName}, flag: {sms.AllCards}<BR> ");
             * }
             */
            /*
             * RabbitMQSection rabbit = (RabbitMQSection) ConfigurationManager.GetSection("rabbitmq");
             * Response.Write($"{rabbit.rEndpoint.RabbitAddress} {rabbit.rEndpoint.RabbitHost}<BR>");
             * Response.Write($"{rabbit.rCredential.RabbitLogin} {rabbit.rCredential.RabbitPassword}<BR>");
             * Response.Write($"{rabbit.rChannel.RabbitExchange} {rabbit.rChannel.RabbitQueue} {rabbit.rChannel.RabbitRoutingKey}<BR>");
             */
            OstCard.Data.Database.Connect(ConfigurationManager.ConnectionStrings["ConString"].ConnectionString);
            OstCard.Data.Database2.Connect(ConfigurationManager.ConnectionStrings["ConString"].ConnectionString);

            /*
             * Ozeki O = new Ozeki(OstCard.Data.Database.Conn);
             * Ozekidata[] od = O.newData(149662);
             *
             * List<Ozekidata> lod = od.ToList<Ozekidata>();
             * lod.RemoveAll(m => ((m.bin.Trim() == "4244368") && (m.prefix_ow.Trim() == "PWU") && (m.company.Trim() == "OOO ARTA")) == true);
             * od = lod.ToArray();
             *
             * O.saveData(od);
             * O.readData(149662);
             * od = O.newData(149665);
             *
             * O.saveData(od);
             * O.deleteData(149662);
             * O.deleteData(149665);
             */

            MenuItem mi = null;
            string   nm = "";

            if (Page.User != null)
            {
                nm = Page.User.Identity.Name;
            }
            if (sc.UserAction(nm, Restrictions.StorageView) || sc.UserAction(nm, Restrictions.StorageFilial))
            {
                mi             = new MenuItem("Хранилище");
                mi.NavigateUrl = "~/Storage.aspx";
                NavigationMenu.Items.Add(mi);
            }
            if (sc.UserAction(nm, Restrictions.CardsView))
            {
                mi             = new MenuItem("Карты");
                mi.NavigateUrl = "~/Card.aspx";
                NavigationMenu.Items.Add(mi);
            }
            if (sc.UserAction(nm, Restrictions.PurchaseView))
            {
                mi             = new MenuItem("Закупка");
                mi.NavigateUrl = "~/Purchase.aspx";
                NavigationMenu.Items.Add(mi);
            }
            if (sc.UserAction(nm, Restrictions.MovingView))
            {
                mi             = new MenuItem("Движение");
                mi.NavigateUrl = "~/StorDoc.aspx";
                NavigationMenu.Items.Add(mi);
            }
            if (sc.UserAction(nm, Restrictions.Reports))
            {
                mi             = new MenuItem("Отчеты");
                mi.NavigateUrl = "~/GenDoc.aspx";
                NavigationMenu.Items.Add(mi);
            }
            if (sc.UserAction(nm, Restrictions.LibraryView) || sc.UserAction(nm, Restrictions.LibraryOrgEdit))
            {
                mi             = new MenuItem("Справочники");
                mi.NavigateUrl = "~/Catalog.aspx";
                NavigationMenu.Items.Add(mi);
            }
            if (sc.UserAction(nm, Restrictions.UserRolesEdit) || sc.UserAction(nm, Restrictions.Events))
            {
                mi             = new MenuItem("Администрирование");
                mi.NavigateUrl = "~/Administration/ManageUsers.aspx";
                if (sc.UserAction(nm, Restrictions.Events))
                {
                    mi.NavigateUrl = "~/Administration/LogView.aspx";
                }
                NavigationMenu.Items.Add(mi);
            }
            mi             = new MenuItem("Контакты");
            mi.NavigateUrl = "~/Administration/Contacts.aspx";
            NavigationMenu.Items.Add(mi);
        }
Exemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                Response.Write("<script language=javascript>window.returnValue='1'; window.close();</script>");
                return;
            }
            Session["First"] = true;

            lock (Database.lockObjectDB)
            {
                perso = sc.UserAction(User.Identity.Name, Restrictions.Perso);

                branch_current     = sc.BranchId(User.Identity.Name);
                branch_main_filial = BranchStore.getBranchMainFilial(branch_current, perso);

                id_doc  = Convert.ToInt32(Request.QueryString["id_doc"]);
                id_type = Convert.ToInt32(Request.QueryString["type_doc"]);
                if (Request.QueryString["id_branch"] != "")
                {
                    id_branch = Convert.ToInt32(Request.QueryString["id_branch"]);
                }
                //bSave.Enabled = false;
                if (id_type == (int)TypeDoc.ToBook124)
                {
                    stat = "(id_stat=4) and (DateClient is null) and id_prop=1";
                    if (branch_main_filial > 0 && branch_main_filial != branch_current)
                    {
                        stat += " and id_BranchCurrent=" + branch_current.ToString();
                    }
                }
                if (id_type == (int)TypeDoc.FromBook124)
                {
                    stat = "(id_stat=19)";
                    if (branch_main_filial > 0 && branch_main_filial != branch_current)
                    {
                        stat += " and id_BranchCurrent=" + branch_current.ToString();
                    }
                }
                if (id_type == (int)TypeDoc.ToGoz)
                {
                    stat = "(id_stat=4) and (DateClient is null) and id_prop=1";
                    if (branch_main_filial > 0 && branch_main_filial != branch_current)
                    {
                        stat += " and id_BranchCurrent=" + branch_current.ToString();
                    }
                }
                if (id_type == (int)TypeDoc.FromGoz)
                {
                    stat = "(id_stat=24)";
                    if (branch_main_filial > 0 && branch_main_filial != branch_current)
                    {
                        stat += " and id_BranchCurrent=" + branch_current.ToString();
                    }
                }
                if (id_type == (int)TypeDoc.SendToClient)
                {
                    // 24.07.20 - для книги 124 было что выдавать может только тот, на ком числится. Теперь выдавать может любой сотрудник филиала
                    //stat = $"(id_stat=4 or ((id_stat=19 or id_stat=24) and id_person={sc.UserId(User.Identity.Name)})) and (DateClient is null) and id_prop=1";
                    stat = $"((id_stat=4 or id_stat=19) or (id_stat=24 and id_person={sc.UserId(User.Identity.Name)})) and (DateClient is null) and id_prop=1";
                    if (branch_main_filial > 0 && branch_main_filial != branch_current)
                    {
                        stat += " and id_BranchCurrent=" + branch_current.ToString();
                    }
                }

                if (id_type == (int)TypeDoc.SendToBank)
                {
                    stat = "id_stat=4";
                    if (branch_main_filial > 0 && branch_main_filial != branch_current)
                    {
                        stat += " and id_BranchCurrent=" + branch_current.ToString();
                    }
                }

                if (id_type == (int)TypeDoc.KillingCard)
                {
                    stat = "(id_stat=4 or id_stat=6)";
                }
                if (id_type == (int)TypeDoc.ReturnToFilial)
                {
                    stat = "id_stat=8";
                }
                if (id_type == (int)TypeDoc.FilialFilial)
                {
                    stat = "id_stat=4";
                }
                if (id_type == (int)TypeDoc.SendToPodotchet)
                {
                    stat = "id_stat=4";
                }
                if (id_type == (int)TypeDoc.FromGozToPodotchet)
                {
                    stat = "id_stat=24";
                }
                if (id_type == (int)TypeDoc.SendToClientFromPodotchet)
                {
                    stat = $"id_stat=15 and id_person=(select id_person from [AccountablePerson_StorageDocs] where id_doc={id_doc})";
                }
                if (id_type == (int)TypeDoc.ReceiveFromPodotchet)
                {
                    stat = $"id_stat=15 and id_person=(select id_person from [AccountablePerson_StorageDocs] where id_doc={id_doc})";
                }
                if (id_type == (int)TypeDoc.ToGozFromPodotchet)
                {
                    stat = $"id_stat=15 and id_person=(select id_person from [AccountablePerson_StorageDocs] where id_doc={id_doc})";
                }


                if (NotSend.Checked == true)
                {
                    id_prb = getExcludeProductsCardsSelect();
                    if (stat.Length > 0)
                    {
                        stat += " and ";
                    }
                    //stat += "datestart is not null and datediff(month,datestart,getdate())>=3";
                    //stat += "datestart is not null and datediff(day,datestart,getdate())>90"; //03.02.2021 поменял на 180 дней
                    stat += "datestart is not null and datediff(day,datestart,getdate())>180";
                    if (id_prb.Length > 0)
                    {
                        stat += " and id_prb not in (" + id_prb + ")";
                    }
                }

                if (!IsPostBack)
                {
                    ZapCombo();
                    tbNumber.Focus();
                    //Refr();
                    NotSend.Text = " (более 6-х месяцев)";
                }

                Session["StorDocCardRec"] = null;
                Session["StorDocCardRec"] = this;
            }
        }