Ejemplo n.º 1
0
        public void Create(ERP_C002_Company tb_C001_Company)
        {
            tb_C001_Company.Validate();
            tb_C001_Company.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            tb_C001_Company.CreateUser = tempUser.UserName;
            this.tb_C001_CompanyRepository.Add(tb_C001_Company);
            this.runtimeService.Commit();
        }
Ejemplo n.º 2
0
        public void Update(ERP_C002_Company tb_C001_Company)
        {
            tb_C001_Company.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            tb_C001_Company.ModifyUser = tempUser.UserName;
            tb_C001_Company.Validate();
            var existstb_Sys_Menu = this.Gettb_C001_CompanyById(tb_C001_Company.Id);

            this.tb_C001_CompanyRepository.SetValues(tb_C001_Company, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
Ejemplo n.º 3
0
        private void OpenForm(string formText, string btnCommand)
        {
            ERP_C002_Company temp = tbC001CompanyBindingSource.Current as ERP_C002_Company;
            CompanyEditForm  edit = new CompanyEditForm(temp);

            edit.Text = formText;
            edit.Tag  = btnCommand;
            if (edit.ShowDialog() != DialogResult.OK)
            {
                tbC001CompanyBindingSource.CancelEdit();
            }
        }
Ejemplo n.º 4
0
 public override void OnBtnCommand(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     // MessageBox.Show(e.Item.Caption);
     //新增
     if (e.Item.Caption == BtnCommandEnum.Add)
     {
         tbC001CompanyBindingSource.AddNew();
         OpenForm("公司资料新增", BtnCommandEnum.Add);
     }
     else if (e.Item.Caption == BtnCommandEnum.Edit)
     {
         OpenForm("公司资料修改", BtnCommandEnum.Edit);
     }
     else if (e.Item.Caption == BtnCommandEnum.Delete)
     {
         if (ERPHelper.Instance.MessageDel())
         {
             ERP_C002_Company user = tbC001CompanyBindingSource.Current as ERP_C002_Company;
             companyService.Delete(user.Id);
             tbC001CompanyBindingSource.RemoveCurrent();
         }
     }
 }
Ejemplo n.º 5
0
        private void LoginForm2_Load(object sender, EventArgs e)
        {
            var companyData = companyService.GetList().Select(a => new { a.Alias, a.CompCode }).ToList();

            txtCompany.Properties.DisplayMember = "Alias";
            txtCompany.Properties.ValueMember   = "CompCode";
            txtCompany.Properties.DataSource    = companyData;
            ERP_C002_Company company = companyService.GetList().FirstOrDefault();

            if (company != null)
            {
                this.txtCompanyName.Text = company.CompName;
                this.txtSystemName.Text  = company.SysName;
            }
            txtFormStyle.SelectedIndex = 0;
            if (!System.IO.Directory.Exists("D:\\MIS"))
            {
                System.IO.Directory.CreateDirectory("D:\\MIS");
            }
            if (!System.IO.Directory.Exists("D:\\MIS\\Project"))
            {
                System.IO.Directory.CreateDirectory("D:\\MIS\\Project");
            }
            if (!System.IO.Directory.Exists("D:\\MIS\\Project\\KQERP"))
            {
                System.IO.Directory.CreateDirectory("D:\\MIS\\Project\\KQERP");
            }
            INIFile inifile = new INIFile(IniFilePath);

            txtUser.Text         = inifile.IniReadValue("Login", "UserName");
            txtPassword.Text     = inifile.IniReadValue("Login", "Pwd");
            txtCompany.EditValue = inifile.IniReadValue("Login", "Company");
            if (string.IsNullOrEmpty(inifile.IniReadValue("PrintLabelSet", "BarPath")))
            {
                inifile.IniWriteValue("PrintLabelSet", "BarPath", @"C:\Program Files (x86)\Seagull\BarTender Suite");
            }
            if (string.IsNullOrEmpty(inifile.IniReadValue("PrintLabelSet", "LabelPath")))
            {
                inifile.IniWriteValue("PrintLabelSet", "LabelPath", @"/f=D:\MIS\Project\KQERP\Label");
            }
            if (string.IsNullOrEmpty(inifile.IniReadValue("PrintLabelSet", "DefaultName")))
            {
                inifile.IniWriteValue("PrintLabelSet", "DefaultName", "200-ALL");
            }
            if (string.IsNullOrEmpty(inifile.IniReadValue("PrintLabelSet", "L")))
            {
                inifile.IniWriteValue("PrintLabelSet", "L", @"/p /x /s=1 /c=2 /prn=PrintName");
            }
            if (string.IsNullOrEmpty(inifile.IniReadValue("PrintLabelSet", "M")))
            {
                inifile.IniWriteValue("PrintLabelSet", "M", @"/p /x /s=1 /c=2 /prn=PrintName");
            }
            if (string.IsNullOrEmpty(inifile.IniReadValue("PrintLabelSet", "S")))
            {
                inifile.IniWriteValue("PrintLabelSet", "S", @"/p /x /s=1 /c=2 /prn=PrintName");
            }
            if (string.IsNullOrEmpty(inifile.IniReadValue("JobLot", "ProcessCode")))
            {
                inifile.IniWriteValue("JobLot", "ProcessCode", "");
            }
        }
Ejemplo n.º 6
0
 public CompanyEditForm(ERP_C002_Company tempData)
 {
     InitializeComponent();
     //this.companyService = companyService;
     tbC001CompanyBindingSource.DataSource = tempData;
 }