Ejemplo n.º 1
0
        private void AttendanceExportWindow_Load(object sender, EventArgs e)
        {
            InitCode code = GlobalDefine.Instance.Init();

            if (code != InitCode.Ok)
            {
                if (MessageBox.Show("配置数据初始化失败.", "", MessageBoxButtons.OK) == DialogResult.OK)
                {
                    Close();
                }
                return;
            }
            UpdateCurrentMonth();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            LogController.SetDebug(true);

            List <IInit> initList = new List <IInit>
            {
                GlobalDefine.Instance,
                AttendanceDataManager.Instance,
                MemberDataManager.Instance,
                OvertimeDataManager.Instance,
                MemberPayDataManager.Instance,
            };

            foreach (var init in initList)
            {
                InitCode code = init.Init();
                if (code != InitCode.Ok)
                {
                    LogController.Log("Init failed code = " + code);
                    return;
                }
            }

            List <ExcelWriter> excelWriters = new List <ExcelWriter>
            {
                new BusinessExcelExporter(),
                new ShoppingGuideExporter(),
                new AdministrativeExport(),
            };

            foreach (ExcelWriter excelWriter in excelWriters)
            {
                excelWriter.Save();
            }

            LogController.Log("===============================Init success=================================");
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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);
            }
        }