Пример #1
0
        public override void ShowEntity()
        {
            string sql        = "select * from testQingjia where workflowinsId=@workflowinsId";
            var    sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);

            sqlBuilder.BeginSelect("testQingjia");
            sqlBuilder.SetWhere("workflowinsId", WorkFlowInsId);
            DataTable dt = sqlBuilder.EndSelect();

            if (dt != null && dt.Rows.Count > 0)//判断是否有数据,有数据读取数据库中的值
            {
                txtUserId.Text      = dt.Rows[0]["userid"].ToString();
                txtUserName.Text    = dt.Rows[0]["userName"].ToString();
                txtDuty.Text        = dt.Rows[0]["dutyCaption"].ToString();
                txtDepartment.Text  = dt.Rows[0]["archCaption"].ToString();
                dtBeginTime.Text    = dt.Rows[0]["beginTime"].ToString();
                dtEndTime.Text      = dt.Rows[0]["endTime"].ToString();
                txtDays.Text        = dt.Rows[0]["Days"].ToString();
                txtQingJia.Text     = dt.Rows[0]["QingJia"].ToString();
                cboQingJiaType.Text = dt.Rows[0]["QingJiaType"].ToString();
            }
            else//如果没有数据,初始化默认值
            {
                txtUserId.Text     = UserId;
                txtUserName.Text   = UserName;
                txtDuty.Text       = DutyCaption;
                txtDepartment.Text = ArchCaption;
                dtBeginTime.Text   = DateTime.Now.ToShortDateString();
                dtEndTime.Text     = DateTime.Now.ToShortDateString();
            }
        }
Пример #2
0
        public override void SaveFormData(bool isDraft)
        {
            base.SaveFormData(isDraft);
            var sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);

            sqlBuilder.BeginSelect("TestEvection");
            sqlBuilder.SetWhere("WorkFlowInsId", WorkFlowInsId);
            DataTable dtTemp = sqlBuilder.EndSelect();

            if (dtTemp != null && dtTemp.Rows.Count > 0)
            {
                sqlBuilder.BeginUpdate("TestEvection");
            }
            else
            {
                sqlBuilder.BeginInsert("TestEvection");
            }

            sqlBuilder.SetValue("WorkFlowId", WorkFlowId);
            sqlBuilder.SetValue("WorkTaskId", WorkTaskId);

            sqlBuilder.SetValue("WorkTaskInsId", WorkTaskInsId);
            sqlBuilder.SetValue("BillCode", txtBillCode.Text);
            if (this.WorkFlowDbProvider.CurrentDbType == CurrentDbType.Oracle)
            {
                sqlBuilder.SetValue("SubmitDate", !string.IsNullOrEmpty(dtSubmitDate.Text) ? BusinessLogic.GetOracleDateFormat(DateTimeHelper.ToDate(dtSubmitDate.Text)) : BusinessLogic.ConvertToDateToString(dtSubmitDate.Text));
            }
            else
            {
                sqlBuilder.SetValue("SubmitDate", BusinessLogic.ConvertToDateToString(dtSubmitDate.Text));
            }
            sqlBuilder.SetValue("SubmitUser", txtSubmitUser.Text);
            sqlBuilder.SetValue("SubmitDepartment", txtDepartment.Text);
            sqlBuilder.SetValue("Total", BusinessLogic.ConvertToNullableDecimal(txtTotal.Text));
            sqlBuilder.SetValue("CnTotal", txtCnTotal.Text);
            if (txtLendPrice.Text.Length != 0)
            {
                sqlBuilder.SetValue("LendPrice", BusinessLogic.ConvertToNullableDecimal(txtLendPrice.Text));
            }
            if (txtFactPrice.Text.Length != 0)
            {
                sqlBuilder.SetValue("FactPrice", BusinessLogic.ConvertToNullableDecimal(txtFactPrice.Text));
            }

            sqlBuilder.SetValue("Reason", txtReason.Text);
            sqlBuilder.SetValue("Description", txtDescription.Text);

            if (dtTemp != null && dtTemp.Rows.Count > 0)
            {
                sqlBuilder.SetWhere("WorkFlowInsId", WorkFlowInsId);
                sqlBuilder.EndUpdate();
            }
            else
            {
                sqlBuilder.SetValue("WorkFlowInsId", WorkFlowInsId);
                sqlBuilder.SetValue("ID", BusinessLogic.NewGuid());
                sqlBuilder.EndInsert();
            }
            SaveEvectionDet();
        }
Пример #3
0
        /// <summary>
        /// 表单数据展现,考虑表单退回重新处理和保存草稿的情况
        ///
        /// </summary>
        private void InitData()
        {
            string sql        = "select * from testQingjia where workflowinsId=@workflowinsId";
            var    sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);

            sqlBuilder.BeginSelect("testQingjia");
            sqlBuilder.SetWhere("workflowinsId", WorkFlowInsId);
            DataTable dt = sqlBuilder.EndSelect();

            if (dt != null && dt.Rows.Count > 0)//判断是否有数据,有数据读取数据库中的值
            {
                lbUserId.Text      = dt.Rows[0]["userid"].ToString();
                lbUserName.Text    = dt.Rows[0]["userName"].ToString();
                lbDutyCaption.Text = dt.Rows[0]["dutyCaption"].ToString();
                lbArchCaption.Text = dt.Rows[0]["archCaption"].ToString();
                tbxStartTime.Value = dt.Rows[0]["beginTime"].ToString();
                tbxEndTime.Value   = dt.Rows[0]["endTime"].ToString();
                tbxDays.Text       = dt.Rows[0]["Days"].ToString();
                tbxQingjia.Text    = dt.Rows[0]["QingJia"].ToString();
                dplType.Text       = dt.Rows[0]["QingJiaType"].ToString();
            }
            else//如果没有数据,初始化默认值
            {
                lbUserId.Text      = UserId;
                lbUserName.Text    = UserName;
                lbDutyCaption.Text = DutyCaption;
                lbArchCaption.Text = ArchCaption;
                tbxStartTime.Value = DateTime.Now.ToShortDateString();
                tbxEndTime.Value   = DateTime.Now.ToShortDateString();
            }
        }
        public override void FormOnLoad()
        {
            //取流程信息
            var dt = RDIFrameworkService.Instance.WorkFlowInstanceService.GetOperatorInstance(this.UserInfo, operatorInsId);

            textBox2.Text = dt.Rows[0]["FlowCaption"].ToString();    //流程名称
            textBox3.Text = dt.Rows[0]["TaskCaption"].ToString();    //任务名称
            textBox4.Text = dt.Rows[0]["FlowInsCaption"].ToString(); //流程实例名称
            WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();  //流程实例Id
            WorkFlowId    = dt.Rows[0]["workflowId"].ToString();     //流程Id
            WorkTaskId    = dt.Rows[0]["WorkTaskId"].ToString();     //任务Id
            WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();  //任务实例Id
            //取业务信息
            var sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);

            sqlBuilder.BeginSelect("TestSaleRetail");
            sqlBuilder.SetWhere("WorkFlowInsId", WorkFlowInsId);
            var saledt = sqlBuilder.EndSelect();

            if (saledt != null && saledt.Rows.Count > 0)
            {
                textBox1.Text       = saledt.Rows[0]["Bill_Caption"].ToString();
                txtBill_sMoney.Text = BusinessLogic.ConvertToString(saledt.Rows[0]["Bill_sMoney"].ToString());
                string flag = BusinessLogic.ConvertToString(saledt.Rows[0]["Bill_AuditFlag"].ToString());
                if (!string.IsNullOrEmpty(flag))
                {
                    switch (flag)
                    {
                    case "1":
                        txtBill_AuditFlag.Text = "直接出库";
                        break;

                    case "2":
                        txtBill_AuditFlag.Text = "出库确认";
                        break;

                    case "3":
                        txtBill_AuditFlag.Text = "不同意出库";
                        break;

                    case "0":
                        txtBill_AuditFlag.Text = "不确定出库类型";
                        break;
                    }
                }
            }
            else
            {
            }
            //取审批列表
            dataGridView1.AutoGenerateColumns = false;
            DataTable auditDt = RDIFrameworkService.Instance.WorkFlowHelperService.GetAuditMessageTableByFlow(this.UserInfo, WorkFlowInsId);

            dataGridView1.DataSource = auditDt;
        }
Пример #5
0
        public override void ShowEntity()
        {
            var sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);

            sqlBuilder.BeginSelect("TestEvection");
            sqlBuilder.SetWhere("WorkFlowInsId", WorkFlowInsId);
            DataTable dtEvection = sqlBuilder.EndSelect();

            if (dtEvection != null && dtEvection.Rows.Count > 0)//检查是否有数据
            {
                txtBillCode.Text    = dtEvection.Rows[0]["BillCode"].ToString();;
                dtSubmitDate.Text   = dtEvection.Rows[0]["SubmitDate"].ToString();
                txtSubmitUser.Text  = dtEvection.Rows[0]["SubmitUser"].ToString();
                txtDepartment.Text  = dtEvection.Rows[0]["SubmitDepartment"].ToString();
                txtReason.Text      = dtEvection.Rows[0]["Reason"].ToString();
                txtTotal.Text       = dtEvection.Rows[0]["Total"].ToString();
                txtCnTotal.Text     = dtEvection.Rows[0]["CnTotal"].ToString();
                txtFactPrice.Text   = dtEvection.Rows[0]["FactPrice"].ToString();
                txtLendPrice.Text   = dtEvection.Rows[0]["LendPrice"].ToString();
                txtDescription.Text = dtEvection.Rows[0]["Description"].ToString();

                sqlBuilder.BeginSelect("TestEvectionDetail");
                sqlBuilder.SetWhere("WorkFlowInsId", WorkFlowInsId);
                evectionDetTable = sqlBuilder.EndSelect();
            }
            else
            {
                txtBillCode.Text        = "Evection-" + BusinessLogic.NewGuid();
                txtSubmitUser.Text      = DateTimeHelper.GetDate(DateTime.Now);
                txtSubmitUser.Text      = this.UserName;
                txtDepartment.Text      = this.ArchCaption;
                this.dtSubmitDate.Value = DateTime.Now;
                sqlBuilder.BeginSelect("TestEvectionDetail");
                sqlBuilder.SetWhere("Id", ""); //得到一个空表
                evectionDetTable = sqlBuilder.EndSelect();
            }

            this.BindDgv();
        }
Пример #6
0
        private void InitData()
        {
            var sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);

            sqlBuilder.BeginSelect("TestEvection");
            sqlBuilder.SetWhere("workflowinsId", WorkFlowInsId);
            DataTable dtEvection = sqlBuilder.EndSelect();

            if (dtEvection != null && dtEvection.Rows.Count > 0)//检查是否有数据
            {
                tbxBillCode.Text   = dtEvection.Rows[0]["BillCode"].ToString();;
                YYSubmitDate.Value = dtEvection.Rows[0]["SubmitDate"].ToString();
                tbxSubmitUser.Text = dtEvection.Rows[0]["SubmitUser"].ToString();
                tbxDept.Text       = dtEvection.Rows[0]["SubmitDepartment"].ToString();
                tbxReason.Text     = dtEvection.Rows[0]["Reason"].ToString();
                tbxTotal.Text      = dtEvection.Rows[0]["Total"].ToString();
                tbxCntotal.Text    = dtEvection.Rows[0]["CnTotal"].ToString();
                tbxFactprice.Text  = dtEvection.Rows[0]["FactPrice"].ToString();
                tbxLendprice.Text  = dtEvection.Rows[0]["LendPrice"].ToString();
                tbxRemark.Text     = dtEvection.Rows[0]["Description"].ToString();

                sqlBuilder.BeginSelect("TestEvectionDetail");
                sqlBuilder.SetWhere("WorkFlowInsId", WorkFlowInsId);
                evectionDetTable = sqlBuilder.EndSelect();
            }
            else
            {
                tbxBillCode.Text   = "Evection-" + BusinessLogic.NewGuid();
                YYSubmitDate.Value = DateTimeHelper.GetDate(DateTime.Now);
                tbxSubmitUser.Text = this.UserName;
                tbxDept.Text       = this.ArchCaption;
                sqlBuilder.BeginSelect("TestEvectionDetail");
                sqlBuilder.SetWhere("Id", ""); //得到一个空表
                evectionDetTable = sqlBuilder.EndSelect();
            }
            GridView1.DataSource = evectionDetTable;
            GridView1.DataBind();
        }
Пример #7
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (tbxStartaddress.Text.Length == 0)
                {
                    ShowMessage(this.Page, "请输入起点。");
                    return;
                }
                if (tbxEndaddress.Text.Length == 0)
                {
                    ShowMessage(this.Page, "请输入终点。");
                    return;
                }

                if (evectionDetTable == null)
                {
                    var sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);
                    sqlBuilder.BeginSelect("TestEvectionDetail");
                    sqlBuilder.SetWhere("Id", ""); //得到一个空表
                    evectionDetTable = sqlBuilder.EndSelect();
                }

                DataRow dr = evectionDetTable.NewRow();
                dr["WorkFlowId"]    = WorkFlowId;
                dr["WorkFlowInsId"] = WorkFlowInsId;
                dr["WorkTaskId"]    = WorkTaskId;
                dr["WorkTaskInsId"] = WorkTaskInsId;
                dr["BillCode"]      = tbxBillCode.Text;
                dr["startaddress"]  = tbxStartaddress.Text;
                dr["endaddress"]    = tbxEndaddress.Text;
                dr["vehicle"]       = drpVehicle.SelectedValue;
                dr["vehiclecost"]   = tbxVehicelcost.Text;
                dr["citycost"]      = tbxCitycost.Text;
                dr["livedays"]      = tbxLivedays.Text;
                dr["liveprice"]     = tbxLiveprice.Text;
                dr["evectiondays"]  = tbxEvectiondays.Text;
                dr["allowance"]     = tbxAllowance.Text;
                dr["others"]        = tbxOthers.Text;
                evectionDetTable.Rows.Add(dr);
                DataBindSource();
                SumTotal();
            }
            catch (Exception ex)
            {
                ShowMessage(this.Page, "增加失败:" + ex.Message.ToString());
            }
        }
Пример #8
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!this.CheckEvectionDetailInput())
            {
                return;
            }

            if (evectionDetTable == null)
            {
                var sqlBuilder = new SQLBuilder(this.WorkFlowDbProvider);
                sqlBuilder.BeginSelect("TestEvectionDetail");
                sqlBuilder.SetWhere("Id", ""); //得到一个空表
                evectionDetTable = sqlBuilder.EndSelect();
            }

            DataRow dr = evectionDetTable.NewRow();

            dr["WorkFlowId"]    = WorkFlowId;
            dr["WorkFlowInsId"] = WorkFlowInsId;
            dr["WorkTaskId"]    = WorkTaskId;
            dr["WorkTaskInsId"] = WorkTaskInsId;
            dr["BillCode"]      = txtBillCode.Text;
            dr["StartAddress"]  = txtStartAddress.Text;
            dr["EndAddress"]    = txtEndAddress.Text;
            dr["Vehicle"]       = cboVehicle.Text;
            dr["VehicleCost"]   = txtVehicleCost.Text;
            dr["CityCost"]      = BusinessLogic.ConvertToNullableDecimal(txtCityCost.Text);
            dr["LiveDays"]      = BusinessLogic.ConvertToNullableDecimal(txtLiveDays.Text);
            dr["LivePrice"]     = BusinessLogic.ConvertToNullableDecimal(txtLivePrice.Text);
            dr["EvectionDays"]  = BusinessLogic.ConvertToNullableDecimal(txtEvectionDays.Text);
            dr["Allowance"]     = BusinessLogic.ConvertToNullableDecimal(txtAllowance.Text);
            dr["Others"]        = BusinessLogic.ConvertToNullableDecimal(txtOthers.Text);
            evectionDetTable.Rows.Add(dr);
            this.BindDgv();
            SumTotal();
        }