Exemplo n.º 1
0
        public TermVo GetTermInfo(string userid)
        {
            ITTermMsDao dao = ComponentLocator.Instance().Resolve <ITTermMsDao>();

            TTermMs termms = dao.getTermbyUserId(userid);

            if (termms == null)
            {
                return(null);
            }
            else
            {
                TermVo termvo = new TermVo();

                PropertiesCopier.CopyProperties(termms, termvo);
                return(termvo);
            }
        }
Exemplo n.º 2
0
        public IList <MFunctioncatalog> GetFunctionDataList()
        {
            IList <MFunctioncatalog> funcvolist   = new List <MFunctioncatalog>();
            IMFunctioncatalogDao     td           = ComponentLocator.Instance().Resolve <IMFunctioncatalogDao>();
            IList <MFunctioncatalog> mfuncatalist = td.GetFunctionCatalogList(LangUtils.GetCurrentLanguage());

            //foreach (MFunctioncatalog mfvo in mfuncatalist)
            //{
            //    FunctionVo fvo = new FunctionVo();
            //    fvo.Langid = mfvo.Id.Langid;
            //    fvo.Catalogid = mfvo.Id.Catalogid;
            //    fvo.Catalogname = mfvo.Catalogname;
            //    fvo.Catalogimage = mfvo.Catalogimage;
            //    funcvolist.Add(fvo);
            //}

            return(mfuncatalist);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 根据区分代码和区分明细代码,检查数据表中是否存在
        ///<param name="clsCd"></param>
        ///<param name="detailCd"></param>
        ///<param name="langCd"></param>
        /// <returns>Boolean</returns>
        /// <returns>CClsDetailNoAR</returns>
        /// </summary>
        public CClsDetailNoAR Check01Vo(string langCd, string clsCd, string detailCd)
        {
            CClsDetailNoAR vo = null;

            try
            {
                if (!String.IsNullOrEmpty(clsCd) && !(string.IsNullOrEmpty(detailCd)) && !(string.IsNullOrEmpty(langCd)))
                {
                    ICClsDetailNoARDao d = ComponentLocator.Instance().Resolve <ICClsDetailNoARDao>();
                    vo = d.GetClsDetail(langCd, clsCd, detailCd);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }

            return(vo);
        }
Exemplo n.º 4
0
        public PersonVo GetPersonByUserId(string userId)
        {
            ITPersonMsDao dao      = ComponentLocator.Instance().Resolve <ITPersonMsDao>();
            TPersonMs     personms = dao.getPersonByUserId(userId);

            if (personms == null)
            {
                throw new ApplicationException(MessageUtils.GetMessage("E0001"));
            }
            else
            {
                PersonVo personvo = new PersonVo();
                PropertiesCopier.CopyProperties(personms, personvo);
                personvo.ICompanyCd = personms.Id.ICompanyCd;
                personvo.IPersonCd  = personms.Id.IPersonCd;

                return(personvo);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 根据客户代码判断是否存在
        /// </summary>
        /// <param name="companyCd"></param>
        /// <param name="dlCd"></param>
        /// <returns></returns>
        public TTradeMs Check01Vo(string companyCd, string dlCd)
        {
            TTradeMs vo = null;

            try
            {
                if (!String.IsNullOrEmpty(companyCd) && !(string.IsNullOrEmpty(dlCd)))
                {
                    ITTradeMsDao d = ComponentLocator.Instance().Resolve <ITTradeMsDao>();
                    vo = d.getTradeByCd(companyCd, dlCd);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }

            return(vo);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 根据部门代码,检查数据表中是否存在
        /// <param name="companyCd">公司代码</param>
        /// <param name="secCd">部门代码</param>
        /// <returns>TSectionMs</returns>
        /// </summary>
        public TSectionMs Check01Vo(String companyCd, String secCd)
        {
            TSectionMs vo = new TSectionMs();

            try
            {
                if (!String.IsNullOrEmpty(secCd))
                {
                    ITSectionMsDao d = ComponentLocator.Instance().Resolve <ITSectionMsDao>();
                    vo = d.getSectionByCd(companyCd, secCd);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }

            return(vo);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 根据工厂代码,检查数据表中是否存在
        /// <param name="facCd">工厂代码</param>
        /// <returns>TFactoryMs</returns>
        /// </summary>
        public TFactoryMs Check01Vo(String facCd)
        {
            TFactoryMs vo = new TFactoryMs();

            try
            {
                if (!String.IsNullOrEmpty(facCd))
                {
                    ITFactoryMsDao d = ComponentLocator.Instance().Resolve <ITFactoryMsDao>();
                    vo = d.getFactoryByCd(facCd);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }

            return(vo);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 执行查询,根据画面的查询条件
        /// </summary>
        private void doSearch()
        {
            IAction_CodeRefPerson ac = ComponentLocator.Instance().Resolve <IAction_CodeRefPerson>();
            string sectionCd         = this.tddlSection.Selectedvalue.Trim();
            string personCd          = this.atxtPersonCd.Text.Trim();
            string personNm          = this.txtPersonNm.Text.Trim();

            DataSet ds = ac.GetPersonDataSet(companyCd, sectionCd, personCd, personNm);

            if (ds.Tables["CTPersonMsNoAR"].Rows.Count > 0)
            {
                this.dataGridView1.DataSource = ds;
                this.dataGridView1.DataMember = "CTPersonMsNoAR";
                SetColumnsAlias();
            }
            else
            {
                Init_GridView();
            }
        }
Exemplo n.º 9
0
        private void LoadData()
        {
            IAction_TestCode         af    = ComponentLocator.Instance().Resolve <IAction_TestCode>();
            IList <MFunctioncatalog> flist = af.GetFunctionDataList();

            DataTable dt = new DataTable();

            dt.Columns.Add("ID");
            dt.Columns.Add("Name");

            foreach (MFunctioncatalog mfvo in flist)
            {
                DataRow dr = dt.NewRow();
                dr[0] = mfvo.Id.Catalogid;
                dr[1] = mfvo.Catalogname;
                dt.Rows.Add(dr);
            }

            this.dgvCode.DataSource = dt;
        }
Exemplo n.º 10
0
        private void TableDropDownList_Load(object sender, EventArgs e)
        {
            if (IsDesignMode())
            {
                return;
            }

            ICTableDropDownListNoARDao     d    = ComponentLocator.Instance().Resolve <ICTableDropDownListNoARDao>();
            IList <CTableDropDownListNoAR> list = new List <CTableDropDownListNoAR>();

            if (this.languageFlg)
            {
                list = d.GetDetail(LangUtils.GetCurrentLanguage(), this.languageColumn, this.tableNm, this.valueColumn, this.nameColumn);
            }
            else
            {
                list = d.GetDetail(this.tableNm, this.valueColumn, this.nameColumn);
            }

            this.comboBox1.Items.Clear();
            if (autoaddblankitem)
            {
                ConditionVo vo = new ConditionVo();
                vo.ConditionValue = "";
                vo.ConditionName  = "";
                this.comboBox1.Items.Add(vo);
            }

            foreach (CTableDropDownListNoAR detail in list)
            {
                ConditionVo conditionvo = new ConditionVo();
                conditionvo.ConditionValue = detail.ICd;
                conditionvo.ConditionName  = detail.IName;
                this.comboBox1.Items.Add(conditionvo);
            }

            this.comboBox1.SelectedIndexChanged += new EventHandler(OnSelectChanged);
            this.comboBox1.SelectedIndex         = this.defaultselectedindex;
        }
Exemplo n.º 11
0
        public IList <FunctionAllVo> GetFunctionDataList()
        {
            IList <FunctionAllVo> functionallvolist = new List <FunctionAllVo>();
            ////Com.GainWinSoft.ERP.Entity.Dao.TestDao td = new Com.GainWinSoft.ERP.Entity.Dao.TestDao();
            ////通过Windsor的组件容器,获取Dao的实例
            ICCatalogHasManyFunctionDao td = ComponentLocator.Instance().Resolve <ICCatalogHasManyFunctionDao>();
            //////调用Dao的方法
            ////IList<MFunctioncatalog> re = td.GetFunctionCatalogList("");

            ////Test td = new Test();
            IList <CCatalogHasManyFunction> mfuncatalist = td.GetFunctionAllList(LangUtils.GetCurrentLanguage());

            foreach (CCatalogHasManyFunction mfvo in mfuncatalist)
            {
                FunctionAllVo functionallvo = new FunctionAllVo();
                functionallvo.Langid       = mfvo.Id.Langid;
                functionallvo.Catalogid    = mfvo.Id.Catalogid;
                functionallvo.Catalogname  = mfvo.Catalogname;
                functionallvo.Catalogimage = mfvo.Catalogimage;
                IList <FunctionVo> funcvolist = new List <FunctionVo>();
                foreach (MFunction f in mfvo.Functionlist)
                {
                    FunctionVo functionvo = new FunctionVo();
                    functionvo.Langid        = f.Id.Langid;
                    functionvo.Functionid    = f.Id.Functionid;
                    functionvo.Catalogid     = f.Catalogid;
                    functionvo.Functionimage = f.Functionimage;
                    functionvo.Functionindex = f.Functionindex;
                    functionvo.Functionname  = f.Functionname;
                    functionvo.Functionpath  = f.Functionpath;
                    funcvolist.Add(functionvo);
                }
                functionallvo.Functionlist = funcvolist;
                functionallvolist.Add(functionallvo);
            }

            //log.Debug("result=" + re);
            return(functionallvolist);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 画面初始化
        /// </summary>
        private void Initialize()
        {
            ToolStripManager.Renderer = new Office2007Renderer();

            this.btnFactoryHelper.Image      = (Image)Com.GainWinSoft.Common.ResourcesUtils.GetResource("AssistantButtonDownArrow");
            this.btnCustomerHelper.Image     = (Image)Com.GainWinSoft.Common.ResourcesUtils.GetResource("AssistantButtonDownArrow");
            this.btnMakerHelper.Image        = (Image)Com.GainWinSoft.Common.ResourcesUtils.GetResource("AssistantButtonDownArrow");
            this.btnItemTypeHelper.Image     = (Image)Com.GainWinSoft.Common.ResourcesUtils.GetResource("AssistantButtonDownArrow");
            this.clsddlItemCls.Selectedindex = 0;
            this.clsddlMntCls.Selectedindex  = 0;

            IAction_MaterialSearch action = ComponentLocator.Instance().Resolve <IAction_MaterialSearch>();

            action.Init_GridView(this.FrmMaterialSearch_pagerGridView1);

            uservo = (LoginUserInfoVo)SessionUtils.GetSession(SessionUtils.COMMON_LOGIN_USER_INFO);

            SetCommonToolstrip();
            SetGroupLayout();

            if (uservo.Factory != null)
            {
                FactoryVo factoryvo = uservo.Factory;
                this.atxtFactoryCd.Text = factoryvo.IFacCd;
                this.lblFactoryNm.Text  = factoryvo.IFacDesc;
                this.tlpG1.Enabled      = false;
                this.tlpG2.Enabled      = true;
                this.tlpG3.Enabled      = false;
                this.firstGroup         = 2;
                this.currentGroup       = 2;
            }
            else
            {
                this.tlpG1.Enabled = true;
                this.firstGroup    = 1;
                this.currentGroup  = 1;
            }
        }
Exemplo n.º 13
0
        private void ClsDetailCodeRefDropDownList_Load(object sender, EventArgs e)
        {
            if (IsDesignMode())
            {
                return;
            }

            ICClsDetailNoARDao     d    = ComponentLocator.Instance().Resolve <ICClsDetailNoARDao>();
            IList <CClsDetailNoAR> list = d.GetClsDetailList(LangUtils.GetCurrentLanguage(), this.clsCd);

            this.comboBox1.Items.Clear();
            if (autoaddblankitem)
            {
                ConditionVo vo = new ConditionVo();
                vo.ConditionValue = "";
                vo.ConditionName  = "";
                this.comboBox1.Items.Add(vo);
            }
            //IList<ConditionVo> result = new List<ConditionVo>();
            foreach (CClsDetailNoAR clsdetail in list)
            {
                ConditionVo conditionvo = new ConditionVo();
                conditionvo.ConditionValue = clsdetail.IClsDetailCd;
                if (showNameDesc)
                {
                    conditionvo.ConditionName = clsdetail.IClsNameDesc;
                }
                else
                {
                    conditionvo.ConditionName = clsdetail.IClsDetailDesc;
                }
                this.comboBox1.Items.Add(conditionvo);
            }


            this.comboBox1.SelectedIndexChanged += new EventHandler(OnSelectChanged);
            this.comboBox1.SelectedIndex         = this.defaultselectedindex;
        }
Exemplo n.º 14
0
        public LoginUserInfoVo GetLoginUserList(string userid, string password)
        {
            LoginUserInfoVo result = null;

            IMLoginUserDao ml        = ComponentLocator.Instance().Resolve <IMLoginUserDao>();
            MLoginUser     loginuser = ml.GetLoginUserInfo(userid, password);

            if ((loginuser != null))
            {
                result                  = new LoginUserInfoVo();
                result.Companyid        = loginuser.Companyid;
                result.Deleteflag       = loginuser.Deleteflag;
                result.Lockflag         = loginuser.Lockflag;
                result.Mappingid        = loginuser.Mappingid;
                result.Namepinyin       = loginuser.Namepinyin;
                result.Password         = loginuser.Password;
                result.Temppasswordflag = loginuser.Temppasswordflag;
                result.Userid           = loginuser.Userid;
                result.Username         = loginuser.Username;
                result.Usertype         = loginuser.Usertype;
            }

            return(result);
        }
Exemplo n.º 15
0
 /// <summary>
 /// 根据画面输入内容,更新数据库
 /// </summary>
 private void SaveData()
 {
     IAction_Factory ac    = ComponentLocator.Instance().Resolve <IAction_Factory>();
     TFactoryMs      facVo = this.getVoFromForm();
     Boolean         val   = ac.SaveDataToStp(strMode, facVo);
 }
Exemplo n.º 16
0
        public void Parse()
        {
            Cursor = Cursors.WaitCursor;

            DockContent frm = this.FindDocument(title);

            if (frm == null)
            {
                IRepositoryFactory factory = ComponentLocator.Instance().Resolve <IRepositoryFactory>();

                IBaseContent frmNewConent = null;
                try
                {
                    frmNewConent = factory.Create(path);
                    //BaseContent frmNewConent = (BaseContent)ComponentLocator.Instance().Resolve(path, typeof(BaseContent));
                    frmNewConent.DockTitle       = title;
                    frmNewConent.Parentdockpanel = parentpanel;
                    frmNewConent.ShowContent(false);
                }
                catch (Exception ex)
                {
                    log.Info(ex.Message);
                }

                //ComponentLocator.Instance().Release(frmNewConent);
            }
            else
            {
                frm.Show(parentpanel);
                frm.BringToFront();
            }

//            #region ***ExchangeRade 利率管理***
//            if ("FExchangeRate".Equals(path))
//            {
//                DockContent frm = this.FindDocument(title);
//                if (frm == null)
//                {
//                    FrmExchangeRate frmExchangeRate = new FrmExchangeRate(parentpanel);
//                    frmExchangeRate.DockTitle = title;
//                    frmExchangeRate.ShowContent(false);
//                }
//                else
//                {
//                    frm.Show(parentpanel);
//                    frm.BringToFront();
//                }
//            }
//            #endregion
//
//            if ("FCompany".Equals(path))
//            {
//                DockContent frm = this.FindDocument(title);
//                if (frm == null)
//                {
//                    FrmCompany frmcompany = new FrmCompany(parentpanel);
//                    frmcompany.DockTitle = title;
//                    frmcompany.ShowContent(false);
//                }
//                else
//                {
//                    frm.Show(parentpanel);
//                    frm.BringToFront();
//                }
//
//                //DockContent frm = this.FindDocument(e.Node.Text);  // FindDocument(e.Node.Text);
//                //if (frm == null)
//                //{
//                //    FrmCompany frmcompany = new FrmCompany(baseform);
//                //    frmcompany.Show(baseform.dockPanel, DockState.Document);
//                //    frmcompany.BringToFront();
//                //    baseform.Show(this.dockpanel);
//
//                //}
//                //else
//                //{
//                //    frm.Show(this.dockpanel);
//                //    frm.BringToFront();
//                //}
//            }
//            if ("FQuotationEntry".Equals(path))
//            {
//                DockContent frm = this.FindDocument(title);
//                if (frm == null)
//                {
//
//                    FrmProductPlan frmproductplan = new FrmProductPlan(parentpanel);
//                    frmproductplan.DockTitle = title;
//                    frmproductplan.ShowContent(false);
//                }
//                else
//                {
//                    frm.Show(parentpanel);
//                    frm.BringToFront();
//                }
//
//
//            }
//
//            #region 物料管理
//            if ("FMaterial".Equals(path))
//            {
//
//                DockContent frm = this.FindDocument(title);  // FindDocument(e.Node.Text);
//                if (frm == null)
//                {
//                    FrmMaterialSearch frmMaterialSearch = new FrmMaterialSearch(parentpanel);
//                    frmMaterialSearch.DockTitle = title;
//                    frmMaterialSearch.ShowContent(false);
//                }
//                else
//                {
//                    frm.Show(parentpanel);
//                    frm.BringToFront();
//                }
//
//
//            }
//            #endregion
//
//            if ("FFactory".Equals(path))
//            {
//                DockContent frm = this.FindDocument(title);  // FindDocument(e.Node.Text);
//                if (frm == null)
//                {
//                    FrmFactory frmFactory = new FrmFactory(parentpanel);
//                    frmFactory.DockTitle = title;
//                    frmFactory.ShowContent(false);
//                }
//                else
//                {
//                    frm.Show(parentpanel);
//                    frm.BringToFront();
//                }
//            }
//


            Cursor = Cursors.Default;
        }
Exemplo n.º 17
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                SplashScreen.UdpateStatusText(MessageUtils.GetMessage("I0001"));
                ToolStripManager.Renderer = new Office2007Renderer();

                //get all condition
                String d = LangUtils.GetDefaultLanguage();
                ConditionUtils.GetAllConditionsList(d);
                Thread.CurrentThread.CurrentUICulture = (System.Globalization.CultureInfo) new System.Globalization.CultureInfo(d);
                rm = new System.Resources.ResourceManager(typeof(MainForm));

                init_ToolStripComboBox();

                //castle windsor initial
                ComponentLocator.Instance();


                LoginUserInfoVo  uservo = (LoginUserInfoVo)SessionUtils.GetSession(SessionUtils.COMMON_LOGIN_USER_INFO);
                IAction_MainForm af     = ComponentLocator.Instance().Resolve <IAction_MainForm>();

                //display status strip
                this.toolStripStatusLabelTime.Text = rm.GetString("Status.Time") + DateTime.Now.GetDateTimeFormats('D')[3].ToString();

                this.toolStripStatusLabelLoginUser.Text = rm.GetString("Status.LoginUser") + uservo.Username;


                SplashScreen.UdpateStatusText(MessageUtils.GetMessage("I0004"));

                //IList<FunctionAllVo> flist = af.GetFunctionDataList();
                //加载用户权限。
                IList <FunctionAllVo> flist = af.GetCatalogFunctionByUserId(uservo.Userid);

                //加载工厂
                TermVo termvo = af.GetTermInfo(uservo.Userid);
                uservo.Term = termvo;
                if (termvo == null)
                {
                    uservo.Factory = null;
                }
                else
                {
                    FactoryVo factory = af.GetFactoryByCd(termvo.IFacCd);
                    uservo.Factory = factory;
                }
                //加载person
                PersonVo person = af.GetPersonByUserId(uservo.Userid);
                uservo.Person = person;

                CompanyConditionVo companycondition = af.GetCompanyCondition(person.ICompanyCd);
                uservo.CompanyCondition = companycondition;

                this.toolStripStatusLabelCompany.Text = companycondition.ICompanyArgDesc;

                //SessionUtils.RemoveSession(SessionUtils.COMMON_LOGIN_USER_INFO);
                //SessionUtils.SetSession(SessionUtils.COMMON_LOGIN_USER_INFO, uservo);



                SplashScreen.UdpateStatusText(MessageUtils.GetMessage("I0002"));
                init_MenuStrip(flist);
                init_MenuWindow(flist);

                //Thread.Sleep(1000);
                //SplashScreen.UdpateStatusTextWithStatus("Success Message", TypeOfMessage.Success);

                SplashScreen.UdpateStatusText(MessageUtils.GetMessage("I0003"));

                this.Show();
                SplashScreen.CloseSplashScreen();
                this.Activate();
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
                this.Dispose();
            }
        }