Beispiel #1
0
        private void btncc_Click(object sender, EventArgs e)
        {
            DAL_Execute bllel = new DAL_Execute();

            if (this.lblId.Text.Length == 0)
            {
                MessageBox.Show(this, "没有选择需要重采的数据行!");
                return;
            }
            if (this.txtywdate.Text.Length == 0)
            {
                MessageBox.Show(this, "请选择‘重采业务时间’!");
                return;
            }
            if (this.txtczdate.Text.Length == 0)
            {
                MessageBox.Show(this, "请选择‘重采操作时间’!");
                return;
            }

            DateTime ywdate   = Convert.ToDateTime(txtywdate.Text.Trim());
            DateTime czdate   = Convert.ToDateTime(txtczdate.Text.Trim());
            int      configid = Convert.ToInt32(lblId.Text.Trim());
            bool     result   = bllel.ExecuteConfig(configid, ywdate, czdate);

            if (result)
            {
                MessageBox.Show(this, "重采成功");
            }
            else
            {
                MessageBox.Show(this, "重采失败");
            }
        }
Beispiel #2
0
        protected void btnCheckout_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtVoluntarilyTime.Text.Trim()))
            {
                txtVoluntarilyTime.Focus();
                MessageBox.Show(this, "执行时间不能为空");
                return;
            }
            else if (string.IsNullOrEmpty(TextBoxValidateDate.Text.Trim()))
            {
                TextBoxValidateDate.Focus();
                MessageBox.Show(this, "首次执行日期不能为空");
                return;
            }
            else if (string.IsNullOrEmpty(TextBoxFileFormatName.Text.Trim()))
            {
                TextBoxFileFormatName.Focus();
                MessageBox.Show(this, "格式化文件名称不能为空");
                return;
            }
            //else if (gridviewVariable.Rows.Count <= 0)
            //{
            //    TxtFormatVariable.Focus();
            //    MessageBox.Show(this, "请添加格式名称变量!");
            //    return;
            //}
            else
            {
                Config model   = new Config();
                string voltime = TextBoxValidateDate.Text.Trim() + " " + txtVoluntarilyTime.Text.Trim();
                model.VoluntarilyTime     = Convert.ToDateTime(voltime);
                model.FileFormatName      = TextBoxFileFormatName.Text.Trim();
                model.BecomeValidateDate  = Convert.ToDateTime(TextBoxValidateDate.Text.Trim());
                model.NextVoluntarilyTime = DateTime.Now;


                List <ConfigFileFormatNameParm> parm = new List <ConfigFileFormatNameParm>();

                foreach (GridViewRow row in gridviewVariable.Rows)
                {
                    ConfigFileFormatNameParm para = new ConfigFileFormatNameParm();
                    para.Name         = row.Cells[2].Text.Trim();
                    para.VariableType = row.Cells[3].Text.Trim();
                    para.DataSource   = row.Cells[4].Text.Trim();
                    para.Connector    = row.Cells[5].Text.Trim();

                    parm.Add(para);
                }
                DAL_Execute bll = new DAL_Execute();
                txtCheckFileName.Text = bll.GetFileFormatName(parm, model);
            }
        }
Beispiel #3
0
        protected void btnFileDownload_Click(object sender, EventArgs e)
        {
            DateTime dt = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00");

            if (this.txtsupcode.Text.Trim().Length == 0)
            {
                MessageBox.Show(this, "供应商编码不能为空");
                return;
            }
            if (this.txtBeginDate.Text.Trim().Length == 0)
            {
                MessageBox.Show(this, "开始时间不能为空");
                return;
            }
            else
            {
                if (Convert.ToDateTime(txtBeginDate.Text.Trim()) >= dt)
                {
                    MessageBox.Show(this, "开始时间不能大于等于今天");
                    return;
                }
            }

            if (this.txtEndDate.Text.Trim().Length == 0)
            {
                MessageBox.Show(this, "截止时间不能为空");
                return;
            }
            else
            {
                if (Convert.ToDateTime(txtEndDate.Text.Trim()) >= dt)
                {
                    MessageBox.Show(this, "截止时间不能大于等于今天");
                    return;
                }
            }


            DAL_Execute dal       = new DAL_Execute();
            string      pathname  = "";
            string      begindate = txtBeginDate.Text.Trim() + " 00:00:00";
            DateTime    dtadd     = Convert.ToDateTime(txtEndDate.Text.Trim()).AddDays(1);
            string      enddate   = txtEndDate.Text.Trim() + " 23:59:59";



            DataSet ds = dal.FileDownloadList(Convert.ToInt32(ConfigId.Value), txtsupcode.Text.Trim(), begindate, enddate, out pathname);

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        StreamExport(ds.Tables[0], null, pathname, this);
                    }
                    else
                    {
                        MessageBox.Show(this, "不存在条件内的数据!");
                    }
                }
                else
                {
                    MessageBox.Show(this, "查询语句错误请确认后再次操作!");
                }
            }
        }
Beispiel #4
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            btnAdd.Visible = false;
            DateTime dt = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00");

            if (hfid.Value == "")
            {
                MessageBox.ShowAndRedirect(this, "选择需要重采的数据行", "DdiConfigList.aspx");
                return;
            }
            if (this.txtywdate.Text.Length == 0)
            {
                MessageBox.Show(this, "请选择‘重采业务时间’!");
                return;
            }
            else
            {
                if (Convert.ToDateTime(txtywdate.Text.Trim()) >= dt)
                {
                    MessageBox.Show(this, "重采业务时间不能大于等于今天");
                    return;
                }
            }
            if (this.txtczdate.Text.Length == 0)
            {
                MessageBox.Show(this, "请选择‘重采操作时间’!");
                return;
            }
            else
            {
                if (Convert.ToDateTime(txtywdate.Text.Trim()) >= dt)
                {
                    MessageBox.Show(this, "重采操作时间不能大于等于今天");
                    return;
                }
            }


            DAL_Execute bllel = new DAL_Execute();

            DateTime ywdate       = Convert.ToDateTime(txtywdate.Text.Trim());
            DateTime czdate       = Convert.ToDateTime(txtczdate.Text.Trim());
            int      configid     = Convert.ToInt32(hfid.Value.Trim());
            bool     CbisDownload = this.CbisDownload.Checked;

            string pathname = "";

            bool result = bllel.ExecuteConfig(configid, ywdate, czdate, out pathname);

            if (result)
            {
                MessageBox.ShowAndRedirect(this, "重采成功", "DdiConfigList.aspx");
                if (this.CbisDownload.Checked == true && pathname != "")
                {
                    FileDownLoad(pathname);
                }
            }
            else
            {
                MessageBox.Show(this, "重采失败");
            }
        }