private bool CheckAuthority() { CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; if (ms1.strFuncAddress == "wfmAssInfo_loss") { return(true); } } } return(false); }
private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } trnoprom.Visible = true; // trAddProduct.Visible = false; trAddProductLost.Visible = false; // trAdjustProduct.Visible = false; trAdjustProductLost.Visible = false; //trAddSales.Visible = false; //trCheck.Visible = false; //trAdjustSales.Visible = false; //trAdjustCheck.Visible = false; // trMaterial.Visible = false; // trFormulaQuery.Visible = false; // trProductQuery.Visible = false; // trOrderDetail.Visible = false; //trOrder.Visible = false; trOrderQuery.Visible = false; trProducePlanQuery.Visible = false; trProducePlanQueryMake.Visible = false; trProducePlanQueryGoods.Visible = false; //trSalesRoomProduce.Visible = false; trProduceCheck.Visible = false; trWarehouseOut.Visible = false; trProduceCheckWh.Visible = false; #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; HtmlTableRow trCurrent = tblProduceMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as HtmlTableRow; if (trCurrent != null) { trCurrent.Visible = true; trnoprom.Visible = false; } } } #endregion }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } #region 设置所有菜单为隐藏 trParaRefresh.Visible = false; trGoods.Visible = false; trLoginOper.Visible = false; trLoginPwd.Visible = false; trNotice.Visible = false; trSysParaSet.Visible = false; trComputationUnit.Visible = false; trInventory.Visible = false; trSupplier.Visible = false; trProviderGoods.Visible = false; trBillOfMaterials.Visible = false; trDeptManage.Visible = false; trWarehouse.Visible = false; trDeptOperManage.Visible = false;; trProductClass.Visible = false; trComputationGroup.Visible = false; #endregion #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; HtmlTableRow trCurrent = tblParaMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as HtmlTableRow; if (trCurrent == null) { trCurrent = tblParaMenu.FindControl("tr" + ms1.strFuncAddress.Replace("tb", String.Empty)) as HtmlTableRow; } if (trCurrent != null) { trCurrent.Visible = true; trnoprom.Visible = false; } } } #endregion }
protected void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } #region 设置所有菜单为隐藏 trAssInfo.Visible = false; trConsItem.Visible = false; trFillQuery.Visible = false; trConsKindQuery.Visible = false; trBusiLogQuery.Visible = false; trTopQuery.Visible = false; trBusiIncome.Visible = false; trDataUpDownQuery.Visible = false; trDailyCashQuery.Visible = false; trSaleDifSum.Visible = false; trCashierDifSum.Visible = false; trSalesSum.Visible = false; trTimeSales.Visible = false; trSaleRatio.Visible = false; trPerformanceOfDay.Visible = false; trConsItemUndo.Visible = false; trUndoCheck.Visible = false; #endregion #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; HtmlTableRow trCurrent = tblQueryMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as HtmlTableRow; if (trCurrent != null) { trCurrent.Visible = true; trnoprom.Visible = false; } } } #endregion }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; bool bis = false; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; if (ms1.strFuncAddress == "wfmPrompt") { bis = true; break; } //HtmlTableRow trCurrent = tblParaMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm",String.Empty)) as HtmlTableRow; // if(trCurrent!=null) // { // // } } } if (bis) { this.ClientScript.RegisterStartupScript(this.GetType(), "show", "<script lanaguage=javascript>ShowHide('1','block');</script>"); } else { this.ClientScript.RegisterStartupScript(this.GetType(), "show", "<script lanaguage=javascript>ShowHide('1',null);</script>"); } #endregion if (!this.IsPostBack) { this.DBBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } #region 设置所有菜单为隐藏 // trEnterStorageReport.Visible=false; // trReceiveMaterialReport.Visible=false; // trStorageCheckLog.Visible=false; trWHStorageRepot.Visible = false; trPoStockReport.Visible = false; trPoStockReturnReport.Visible = false; trInventoryMoveReport.Visible = false; trDeptStorageEnterReport.Visible = false; trDeptInventoryLostReport.Visible = false; trSaleDailyCheckReport.Visible = false; trStorageBalanceReport.Visible = false; trStorageHisReport.Visible = false; #endregion #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; HtmlTableRow trCurrent = tblStorageReportMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as HtmlTableRow; if (trCurrent != null) { trCurrent.Visible = true; trnoprom.Visible = false; } } } #endregion }
private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } trnoprom.Visible = true; trProductListReport.Visible = false; trProductSumReport.Visible = false; trProductLostListReport.Visible = false; trProductLostSumReport.Visible = false; // trSalesCheckListReport.Visible = false; // trSalesCheckSumReport.Visible = false; // trSalesChart.Visible = false; trProduceLogReport.Visible = false; trProduceLostSalesReport.Visible = false; trProductMaterialUseReorpt.Visible = false; trCostReport.Visible = false; #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; HtmlTableRow trCurrent = tblProduceMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as HtmlTableRow; if (trCurrent != null) { trCurrent.Visible = true; trnoprom.Visible = false; } } } #endregion }
protected void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } #region 设置所有菜单为隐藏 trSaleDailyCheck.Visible = false; trSaleLoseNew.Visible = false; trProvider.Visible = false; trBillOfReceive.Visible = false; trBillOfEnterStorage.Visible = false; trProductMove.Visible = false; trStockPlan.Visible = false; trBillValidEnter.Visible = false; trDestroyConfirm.Visible = false; trStorageSet.Visible = false; #endregion #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; HtmlTableRow trCurrent = tblStorageMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as HtmlTableRow; if (trCurrent != null) { trCurrent.Visible = true; trnoprom.Visible = false; } } } #endregion }
private bool CanUseModule(HttpApplication application, string strLoginID, string strPage) { Hashtable htOperFunc = (Hashtable)application.Context.Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[strLoginID]; bool bis = false; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; string strfa = ms1.strFuncAddress.Split('_')[0]; if (strfa + ".aspx" == strPage) { bis = true; break; } } } return(bis); }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here CMSMStruct.LoginStruct ls1 = new CommCenter.CMSMStruct.LoginStruct(); if (Session["Login"] == null) { Response.Redirect("Exit.aspx"); } else { ls1 = (CMSMStruct.LoginStruct)Session["Login"]; } #region 设置所有菜单为隐藏 trEmpInfo.Visible = false; trWorkDailyEvery.Visible = false; trShcQuery.Visible = false; trSignCalc.Visible = false; trEmpUnitSign.Visible = false; trSignQuery.Visible = false; #endregion #region 控制当前显示菜单 Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; HtmlTableRow trCurrent = tblEmpMenu.FindControl("tr" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as HtmlTableRow; if (trCurrent != null) { trCurrent.Visible = true; trnoprom.Visible = false; } } } #endregion }
public int UpdateOperPurview(string strOperID, ArrayList alfunc, string strFuncType) { con.Open(); using (SqlTransaction tran = con.BeginTransaction()) { try { string sql1 = "delete from tbOperFunc where vcOperID='" + strOperID + "'"; sql1 += " and vcFuncAddress IN(SELECT cnvcFuncAddress FROM tbFunc WHERE cnvcFuncType = '" + strFuncType + "')"; SqlHelper.ExecuteNonQuery(con, tran, CommandType.Text, sql1); string sql2 = ""; for (int i = 0; i < alfunc.Count; i++) { CMSMStruct.MenuStruct ms = (CMSMStruct.MenuStruct)alfunc[i]; sql2 = "insert into tbOperFunc values('" + strOperID + "','" + ms.strFuncName + "','" + ms.strFuncAddress + "')"; SqlHelper.ExecuteNonQuery(con, tran, CommandType.Text, sql2); } tran.Commit(); } catch (Exception e) { tran.Rollback(); clog.WriteLine(e); return(0); } finally { if (con.State == ConnectionState.Open) { con.Close(); } } return(1); } }
protected void Page_Load(object sender, EventArgs e) { #region 控制当前显示菜单 CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"]; Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; System.Web.UI.HtmlControls.HtmlGenericControl trCurrent = this.FindControl("li" + ms1.strFuncAddress.Replace("wfm", String.Empty)) as System.Web.UI.HtmlControls.HtmlGenericControl; if (trCurrent == null) { trCurrent = this.FindControl("li" + ms1.strFuncAddress.Replace("tb", String.Empty)) as System.Web.UI.HtmlControls.HtmlGenericControl; } if (trCurrent != null) { trCurrent.Visible = true; } } } #endregion }
protected void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here this.btnExcel.Attributes.Add("onclick", "javascript:window.open('../DataGridToExcel.aspx', 'Sample', 'toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=no,resizable=yes,copyhistory=yes,width=790,height=520,left=0,top=0')"); if (Session["Login"] != null) { CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"]; // if(ls1.strLimit!="CL001") // { // this.SetErrorMsgPageBydir("对不起,你没有权限使用此功能!"); // return; // } if (!IsPostBack) { this.FillDropDownList("tbCommCode", ddlAssType, "vcCommSign ='AT'", "全部"); this.FillDropDownList("tbCommCode", ddlDept, "vcCommSign ='MD' and vcCommCode<>'FYZX1'", "全部"); this.FillDropDownList("tbCommCode", ddlBillType, "vcCommSign ='PT'", "全部"); this.FillDropDownList("tbCommCode", ddlAssState, "vcCommSign ='AS'", "所有"); this.FillDropDownList("AllREGION", ddlRegion, "", "全部"); this.ddlConsFlag.Items.Add(new ListItem("正常消费", "0")); this.ddlConsFlag.Items.Add(new ListItem("已撤消", "9")); this.ddlConsFlag.SelectedIndex = 0; if (ls1.strLimit != "CL001") { ddlDept.Items.FindByValue(ls1.strDeptID).Selected = true; ddlDept.Enabled = false; ddlRegion.Enabled = false; } strBeginDate = DateTime.Now.ToShortDateString(); strEndDate = DateTime.Now.ToShortDateString(); string strDept = ddlDept.SelectedValue; Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; busiq = new BusiComm.BusiQuery(strcons); DataTable dtoper = busiq.GetConsOperList(strDept, strBeginDate, strEndDate); this.FillDropDownList(dtoper, ddlOper, "全部"); Session.Remove("QUERY"); Session.Remove("toExcel"); Session.Remove("page_view"); #region 控制按钮显示 this.Button1.Visible = false; this.Button2.Visible = false; Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; System.Web.UI.WebControls.Button btnCurrent = this.FindControl(ms1.strFuncAddress.Replace("wfmConsItem_", String.Empty)) as System.Web.UI.WebControls.Button; if (btnCurrent != null) { btnCurrent.Visible = true; this.Button2.Visible = true; } } } #endregion } else { strBeginDate = Request.Form["txtBegin"].ToString(); strEndDate = Request.Form["txtEnd"].ToString(); } } else { Response.Redirect("../Exit.aspx"); } }
public void ParaInit(System.Web.HttpApplicationState app) { try { DataSet dsIn = new DataSet(); InitCode inc = new InitCode(); Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; DataSet dsOut = inc.LoadCodeTable(strcons); //错误返回表 //返回结果存放到Application app["tbCommCode"] = dsOut.Tables["tbCommCode"]; app["AllMD"] = dsOut.Tables["AllMD"]; app["MAC"] = dsOut.Tables["MAC"]; app["OperFunc"] = dsOut.Tables["OperFunc"]; app["IOTime"] = dsOut.Tables["IOTime"]; app["Goods"] = dsOut.Tables["Goods"]; app["PClass"] = dsOut.Tables["PClass"]; app["AllMaterial"] = dsOut.Tables["AllMaterial"]; app["Provider"] = dsOut.Tables["Provider"]; app["NewDept"] = dsOut.Tables["NewDept"]; app["tbNameCodeToStorage"] = dsOut.Tables["tbNameCodeToStorage"]; app["tbFormula"] = dsOut.Tables["tbFormula"]; app["DeptMapInfo"] = dsOut.Tables["DeptMapInfo"]; app["Warehouse"] = dsOut.Tables["Warehouse"]; app["ComputationGroup"] = dsOut.Tables["ComputationGroup"]; app["ComputationUnit"] = dsOut.Tables["ComputationUnit"]; Hashtable htOperFunc = new Hashtable(); DataTable dttmp = dsOut.Tables["OperFunc"]; if (dttmp.Rows.Count > 0) { string strOperID = ""; ArrayList alFuncList = null; for (int i = 0; i < dttmp.Rows.Count; i++) { CMSMStruct.MenuStruct menu1 = new CMSMStruct.MenuStruct(); menu1.strFuncName = dttmp.Rows[i]["vcFuncName"].ToString(); menu1.strFuncAddress = dttmp.Rows[i]["vcFuncAddress"].ToString(); if (strOperID == dttmp.Rows[i]["vcOperID"].ToString()) { alFuncList.Add(menu1); if (i == dttmp.Rows.Count - 1) { htOperFunc.Add(strOperID, alFuncList); } } else { if (strOperID != "" && alFuncList.Count > 0) { htOperFunc.Add(strOperID, alFuncList); } alFuncList = new ArrayList(); alFuncList.Add(menu1); strOperID = dttmp.Rows[i]["vcOperID"].ToString(); if (i == dttmp.Rows.Count - 1) { htOperFunc.Add(strOperID, alFuncList); } } } } app["OperFunc"] = htOperFunc; Hashtable htIOTime = new Hashtable(); dttmp = null; dttmp = dsOut.Tables["IOTime"]; if (dttmp.Rows.Count > 0) { string strOfficer = ""; ArrayList altmp = null; for (int i = 0; i < dttmp.Rows.Count; i++) { CMSMStruct.SignIOTimeStruct sio1 = new CommCenter.CMSMStruct.SignIOTimeStruct(); sio1.strSIOTID = dttmp.Rows[i]["iotName"].ToString(); sio1.strOfficer = dttmp.Rows[i]["Officer"].ToString(); sio1.strClassName = dttmp.Rows[i]["vcClassName"].ToString(); sio1.strClassId = dttmp.Rows[i]["vcClassId"].ToString(); sio1.strInTime = dttmp.Rows[i]["InTime"].ToString(); sio1.strOutTime = dttmp.Rows[i]["OutTime"].ToString(); if (strOfficer == sio1.strOfficer) { altmp.Add(sio1); if (i == dttmp.Rows.Count - 1) { htIOTime.Add(strOfficer, altmp); } } else { if (strOfficer != "" && altmp.Count > 0) { htIOTime.Add(strOfficer, altmp); } altmp = new ArrayList(); altmp.Add(sio1); strOfficer = sio1.strOfficer; if (i == dttmp.Rows.Count - 1) { htIOTime.Add(strOfficer, altmp); } } } } app["IOTime"] = htIOTime; app.UnLock(); } catch (Exception e) { AMSLog clog = new AMSLog(); clog.WriteLine(e); } }
protected void btrefresh_Click(object sender, System.EventArgs e) { try { DataSet dsIn = new DataSet(); InitCode inc = new InitCode(); Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; DataSet dsOut = inc.LoadCodeTable(strcons); AMSApp.zhenghua.Business.Helper.LoadInitCode(Application); //错误返回表 //返回结果存放到Application Application.Set("tbCommCode", dsOut.Tables["tbCommCode"]); Application.Set("AssAT", dsOut.Tables["AssAT"]); Application.Set("AT1", dsOut.Tables["AT1"]); Application.Set("AllMD", dsOut.Tables["AllMD"]); Application.Set("MAC", dsOut.Tables["MAC"]); Application.Set("OperFunc", dsOut.Tables["OperFunc"]); Application.Set("IOTime", dsOut.Tables["IOTime"]); Application.Set("Goods", dsOut.Tables["Goods"]); Application.Set("PClass", dsOut.Tables["PClass"]); Application.Set("AllMaterial", dsOut.Tables["AllMaterial"]); Application.Set("Provider", dsOut.Tables["Provider"]); Application.Set("NewDept", dsOut.Tables["NewDept"]); Application.Set("tbNameCodeToStorage", dsOut.Tables["tbNameCodeToStorage"]); Application.Set("tbFormula", dsOut.Tables["tbFormula"]); Application.Set("DeptMapInfo", dsOut.Tables["DeptMapInfo"]); Application.Set("Warehouse", dsOut.Tables["Warehouse"]); Application.Set("ComputationGroup", dsOut.Tables["ComputationGroup"]); Application.Set("ComputationUnit", dsOut.Tables["ComputationUnit"]); Hashtable htOperFunc = new Hashtable(); DataTable dttmp = dsOut.Tables["OperFunc"]; if (dttmp.Rows.Count > 0) { string strOperID = ""; ArrayList alFuncList = null; for (int i = 0; i < dttmp.Rows.Count; i++) { CMSMStruct.MenuStruct menu1 = new CMSMStruct.MenuStruct(); menu1.strFuncName = dttmp.Rows[i]["vcFuncName"].ToString(); menu1.strFuncAddress = dttmp.Rows[i]["vcFuncAddress"].ToString(); if (strOperID == dttmp.Rows[i]["vcOperID"].ToString()) { alFuncList.Add(menu1); if (i == dttmp.Rows.Count - 1) { htOperFunc.Add(strOperID, alFuncList); } } else { if (strOperID != "" && alFuncList.Count > 0) { htOperFunc.Add(strOperID, alFuncList); } alFuncList = new ArrayList(); alFuncList.Add(menu1); strOperID = dttmp.Rows[i]["vcOperID"].ToString(); if (i == dttmp.Rows.Count - 1) { htOperFunc.Add(strOperID, alFuncList); } } } } Application.Set("OperFunc", htOperFunc); Hashtable htIOTime = new Hashtable(); dttmp = null; dttmp = dsOut.Tables["IOTime"]; if (dttmp.Rows.Count > 0) { string strOfficer = ""; ArrayList altmp = null; for (int i = 0; i < dttmp.Rows.Count; i++) { CMSMStruct.SignIOTimeStruct sio1 = new CommCenter.CMSMStruct.SignIOTimeStruct(); sio1.strSIOTID = dttmp.Rows[i]["iotName"].ToString(); sio1.strOfficer = dttmp.Rows[i]["Officer"].ToString(); sio1.strClassName = dttmp.Rows[i]["vcClassName"].ToString(); sio1.strClassId = dttmp.Rows[i]["vcClassId"].ToString(); sio1.strInTime = dttmp.Rows[i]["InTime"].ToString(); sio1.strOutTime = dttmp.Rows[i]["OutTime"].ToString(); if (strOfficer == sio1.strOfficer) { altmp.Add(sio1); if (i == dttmp.Rows.Count - 1) { htIOTime.Add(strOfficer, altmp); } } else { if (strOfficer != "" && altmp.Count > 0) { htIOTime.Add(strOfficer, altmp); } altmp = new ArrayList(); altmp.Add(sio1); strOfficer = sio1.strOfficer; if (i == dttmp.Rows.Count - 1) { htIOTime.Add(strOfficer, altmp); } } } } Application.Set("IOTime", htIOTime); Application.UnLock(); //ynhnTransportManage.Helpers.SyncDept(); //ynhnTransportManage.Helpers.SyncOper(); //var uow = System.Web.Mvc.DependencyResolver.Current.GetService<IFairiesMemberManageUow>(); var uow = DependencyResolver.Current.GetService <IFairiesMemberManageUow>(); var amsuow = DependencyResolver.Current.GetService <IAMSCMUow>(); DXInfo.Business.Common businessCommon = new DXInfo.Business.Common(uow); Common centerCommon = new Common(uow); businessCommon.SyncDept(amsuow); //Uow, AmscmUow); centerCommon.SyncOper(amsuow); //Uow, AmscmUow); this.SetSuccMsgPageBydir("参数刷新成功!", "paraconf/wfmParaRefresh.aspx"); } catch (Exception er) { AMSLog clog = new AMSLog(); clog.WriteLine(er); } }
protected void btrefresh_Click(object sender, System.EventArgs e) { try { DataSet dsIn = new DataSet(); InitCode inc = new InitCode(); Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; DataSet dsOut = inc.LoadCodeTable(strcons); AMSApp.zhenghua.Business.Helper.LoadInitCode(Application); //错误返回表 //返回结果存放到Application Application.Set("tbCommCode", dsOut.Tables["tbCommCode"]); Application.Set("AllMD", dsOut.Tables["AllMD"]); Application.Set("AllREGION", dsOut.Tables["AllREGION"]); Application.Set("AllMDP", dsOut.Tables["AllMDP"]); Application.Set("AcctMonth", dsOut.Tables["AcctMonth"]); Application.Set("MAC", dsOut.Tables["MAC"]); Application.Set("Goods", dsOut.Tables["Goods"]); Application.Set("PClass", dsOut.Tables["PClass"]); Application.Set("AllMaterial", dsOut.Tables["AllMaterial"]); Application.Set("Provider", dsOut.Tables["Provider"]); Application.Set("NewDept", dsOut.Tables["NewDept"]); Application.Set("tbNameCodeToStorage", dsOut.Tables["tbNameCodeToStorage"]); Application.Set("tbFormula", dsOut.Tables["tbFormula"]); Application.Set("DeptMapInfo", dsOut.Tables["DeptMapInfo"]); Hashtable htOperFunc = new Hashtable(); DataTable dttmp = dsOut.Tables["OperFunc"]; if (dttmp.Rows.Count > 0) { string strOperID = ""; ArrayList alFuncList = null; for (int i = 0; i < dttmp.Rows.Count; i++) { CMSMStruct.MenuStruct menu1 = new CMSMStruct.MenuStruct(); menu1.strFuncName = dttmp.Rows[i]["vcFuncName"].ToString(); menu1.strFuncAddress = dttmp.Rows[i]["vcFuncAddress"].ToString(); if (strOperID == dttmp.Rows[i]["vcOperID"].ToString()) { alFuncList.Add(menu1); if (i == dttmp.Rows.Count - 1) { htOperFunc.Add(strOperID, alFuncList); } } else { if (strOperID != "" && alFuncList.Count > 0) { htOperFunc.Add(strOperID, alFuncList); } alFuncList = new ArrayList(); alFuncList.Add(menu1); strOperID = dttmp.Rows[i]["vcOperID"].ToString(); if (i == dttmp.Rows.Count - 1) { htOperFunc.Add(strOperID, alFuncList); } } } } Application.Set("OperFunc", htOperFunc); Hashtable htIOTime = new Hashtable(); dttmp = null; dttmp = dsOut.Tables["IOTime"]; if (dttmp.Rows.Count > 0) { string strOfficer = ""; ArrayList altmp = null; for (int i = 0; i < dttmp.Rows.Count; i++) { CMSMStruct.SignIOTimeStruct sio1 = new CommCenter.CMSMStruct.SignIOTimeStruct(); sio1.strSIOTID = dttmp.Rows[i]["iotName"].ToString(); sio1.strOfficer = dttmp.Rows[i]["Officer"].ToString(); sio1.strClassName = dttmp.Rows[i]["vcClassName"].ToString(); sio1.strClassId = dttmp.Rows[i]["vcClassId"].ToString(); sio1.strInTime = dttmp.Rows[i]["InTime"].ToString(); sio1.strOutTime = dttmp.Rows[i]["OutTime"].ToString(); if (strOfficer == sio1.strOfficer) { altmp.Add(sio1); if (i == dttmp.Rows.Count - 1) { htIOTime.Add(strOfficer, altmp); } } else { if (strOfficer != "" && altmp.Count > 0) { htIOTime.Add(strOfficer, altmp); } altmp = new ArrayList(); altmp.Add(sio1); strOfficer = sio1.strOfficer; if (i == dttmp.Rows.Count - 1) { htIOTime.Add(strOfficer, altmp); } } } } Application.Set("IOTime", htIOTime); Application.UnLock(); this.SetSuccMsgPageBydir("参数刷新成功!", "wfmWelcome.aspx"); } catch (Exception er) { AMSLog clog = new AMSLog(); clog.WriteLine(er); } }
//protected ucPageView UcPageView1; protected void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 if (Session["Login"] != null) { if (!this.IsPostBack) { // this.BindDept(ddlDept, "cnvcDeptType <>'Corp'"); // ListItem li = new ListItem("所有", "%"); // this.ddlDept.Items.Add(li); // this.SetDDL(this.ddlDept,this.oper.strDeptID); // if(this.oper.strDeptID !="CEN00") // { // this.ddlDept.Enabled = false; // } CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"]; this.txtBeginDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.txtEndDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); string strtype = this.Request["type"].ToString(); this.BindCommCode(ddlDept, "vcCommSign='md' and vcCommCode not in ('MDXSB','MDCW1','FYZX1','CEN00')"); ListItem li = new ListItem("所有", "%"); ddlDept.Items.Add(li); this.FillDropDownList("AllREGION", ddlRegion, "", "全部"); string str = ""; if (strtype == "1") { this.Label3.Text = "销售差异汇总表"; str = "wfmSaleDifSum1_"; lblOperName.Visible = false; txtOperName.Visible = false; } else { str = "wfmSaleDifSum2_"; this.Label3.Text = "收银员收款差异统计表"; } Session["Get_Dept_Dif"] = null; Session["Get_Oper_Dif"] = null; #region 控制按钮显示 this.Button3.Visible = false; Hashtable htOperFunc = (Hashtable)Application["OperFunc"]; ArrayList almenu = (ArrayList)htOperFunc[ls1.strLoginID]; if (almenu != null) { for (int i = 0; i < almenu.Count; i++) { CMSMStruct.MenuStruct ms1 = (CMSMStruct.MenuStruct)almenu[i]; System.Web.UI.WebControls.Button btnCurrent = this.FindControl(ms1.strFuncAddress.Replace(str, String.Empty)) as System.Web.UI.WebControls.Button; if (btnCurrent != null) { btnCurrent.Visible = true; } } } #endregion } this.FootBar.Visible = false; if (this.Label3.Text == "销售差异汇总表") { if (Session["Get_Dept_Dif"] != null) { if (((DataTable)Session["Get_Dept_Dif"]).Rows.Count > 0) { this.FootBar.Visible = true; } } } else { if (Session["Get_Oper_Dif"] != null) { if (((DataTable)Session["Get_Oper_Dif"]).Rows.Count > 0) { this.FootBar.Visible = true; } } } if (DataGrid1.DataSource != null) { if (((DataTable)DataGrid1.DataSource).Rows.Count > 0) { this.FootBar.Visible = true; } } } else { Response.Redirect("../Exit.aspx"); } }