Esempio n. 1
0
        /// <summary>
        /// 保存执行单配置信息
        /// </summary>
        /// <param name="workID">机构ID</param>
        /// <param name="billEntity">执行单信息</param>
        /// <param name="channelList">用法信息</param>
        /// <param name="delList">执行单关联用法信息</param>
        /// <returns>true:保存成功</returns>
        public int SaveBillChannelInfo(int workID, Basic_ExecuteBills billEntity, List <Basic_ExecuteBillChannel> channelList, List <Basic_ExecuteBillChannel> delList)
        {
            try
            {
                int res = 1;
                this.BindDb(billEntity);
                res = billEntity.save();

                foreach (Basic_ExecuteBillChannel temp in channelList)
                {
                    this.BindDb(temp);
                    temp.ExecBillID = billEntity.ID;
                    res             = temp.save();
                }

                foreach (Basic_ExecuteBillChannel temp in delList)
                {
                    this.BindDb(temp);
                    res = temp.delete();
                }

                return(res);
            }
            catch
            {
                return(-1);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 停用或启用执行单
        /// </summary>
        /// <param name="sender">控件</param>
        /// <param name="e">参数</param>
        private void btnStop_Click(object sender, EventArgs e)
        {
            if (dgExecBill.CurrentCell == null)
            {
                return;
            }

            RowIndex = dgExecBill.CurrentCell.RowIndex;
            DataTable          dt         = (DataTable)dgExecBill.DataSource;
            Basic_ExecuteBills billEntity = new Basic_ExecuteBills();

            billEntity = EFWCoreLib.CoreFrame.Common.ConvertExtend.ToObject <Basic_ExecuteBills>(dt, RowIndex);
            if (btnStop.Text == "启用(&U)")
            {
                billEntity.DelFlag = 0;
            }
            else
            {
                billEntity.DelFlag = 1;
            }

            List <Basic_ExecuteBillChannel> channelList = new List <Basic_ExecuteBillChannel>();

            if (Convert.ToInt32(InvokeController("UpdateFlag", billEntity.ID, billEntity.DelFlag)) > 0)
            {
                InvokeController("BindExecBillInfo", cbbWork.SelectedValue, txtQueryName.Text);
                setGridSelectIndex(dgExecBill);
            }
        }
Esempio n. 3
0
        public int SaveBillChannelInfo(int workID, Basic_ExecuteBills billEntity, List <Basic_ExecuteBillChannel> channelList, List <Basic_ExecuteBillChannel> deleteList)
        {
            var retdata = InvokeWcfService(
                "BaseProject.Service",
                "ExceBillController",
                "SaveBillChannelInfo",
                (request) =>
            {
                request.AddData(workID);
                request.AddData(billEntity);
                request.AddData(channelList);
                request.AddData(deleteList);
            });

            return(retdata.GetData <int>(0));
        }
Esempio n. 4
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender">控件</param>
        /// <param name="e">参数</param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text) == true)
            {
                MessageBoxEx.Show("执行单名称不能为空!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (Convert.ToBoolean(InvokeController("CheckName", Convert.ToInt32(cbbWork.SelectedValue), ID, txtName.Text)) == false)
            {
                MessageBoxEx.Show("执行单名称不能重复!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(intCode.Text))
            {
                MessageBoxEx.Show("报表文件编码不能为空!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (intCode.Value <= 0)
            {
                MessageBoxEx.Show("请输入正确的报表文件编码!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            int flag = ID;
            Basic_ExecuteBills billEntity = new Basic_ExecuteBills();

            billEntity.ID         = ID;
            billEntity.BillName   = txtName.Text;
            billEntity.ReportFile = intCode.Text;
            billEntity.PYCode     = EFWCoreLib.CoreFrame.Common.SpellAndWbCode.GetSpellCode(txtName.Text);
            billEntity.WBCode     = EFWCoreLib.CoreFrame.Common.SpellAndWbCode.GetWBCode(txtName.Text);
            if (flag == 0)
            {
                billEntity.DelFlag = 0;
            }

            List <Basic_ExecuteBillChannel> channelList = new List <Basic_ExecuteBillChannel>();
            DataTable dtChannel = dgChannel.DataSource as DataTable;

            for (int i = 0; i < dtChannel.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(Convert.ToString(dtChannel.Rows[i]["ChannelName"])) == false)
                {
                    Basic_ExecuteBillChannel channelEntity = new Basic_ExecuteBillChannel();
                    if (string.IsNullOrEmpty(Convert.ToString(dtChannel.Rows[i]["ID"])) == false)
                    {
                        channelEntity.ID = Convert.ToInt32(dtChannel.Rows[i]["ID"]);
                    }

                    channelEntity.ExecBillID = ID;
                    channelEntity.ChannelID  = Convert.ToInt32(dtChannel.Rows[i]["ChannelID"]);
                    channelList.Add(channelEntity);
                }
            }

            if (Convert.ToInt32(InvokeController("SaveBillChannelInfo", Convert.ToInt32(cbbWork.SelectedValue), billEntity, channelList, DeleteList)) > 0)
            {
                InvokeController("BindExecBillInfo", Convert.ToInt32(cbbWork.SelectedValue), txtQueryName.Text);
                if (flag > 0)
                {
                    setGridSelectIndex(dgExecBill);
                }
                else
                {
                    setGridSelectIndex(dgExecBill, dgExecBill.Rows.Count - 1);
                }

                btnNew.Enabled     = true;
                btnEdit.Enabled    = true;
                btnStop.Enabled    = true;
                btnCancel.Enabled  = false;
                btnSave.Enabled    = false;
                btnQuery.Enabled   = true;
                panInfo.Enabled    = false;
                dgChannel.ReadOnly = true;
                dgChannel.EndEdit();
                //DeleteStr = string.Empty;
            }
        }