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(); } } }
protected void bNewAccountablePerson_Click(object sender, EventArgs e) { try { AccountablePersonData apd = fillFromForm(); int idBranch = sc.BranchId(Page.User.Identity.Name); db.saveAccountablePersonData(apd, idBranch); RefreshList(0); selectID(); } catch (Exception e1) { ClientScript.RegisterClientScriptBlock(GetType(), "bNew_ReClick", "<script type='text/javascript'>$(document).ready(function(){ " + "clickNew(); ShowError('" + System.Security.SecurityElement.Escape(e1.Message) + "'); });</script>"); } }
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; }
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(); }
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(); } } }
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(); } } }
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 = ""; }
public String getDepName() { lock (OstCard.Data.Database.lockObjectDB) { ServiceClass sc = new ServiceClass(); int idBranch = sc.BranchId(Page.User.Identity.Name); if (idBranch < 1) { return(""); } DataSet ds = new DataSet(); OstCard.Data.Database.ExecuteQuery("select ident_dep from branchs where id=" + idBranch.ToString(), ref ds, null); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { return("(" + ds.Tables[0].Rows[0]["ident_dep"].ToString() + ")"); } return(""); } }
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); } } }
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(); } } }
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; } } }
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; } }