Exemplo n.º 1
0
        /// <summary>
        /// 处理使用状态名称(染色合同)
        /// </summary>
        /// <param name="p_Dt">数据表</param>
        public static void ProcColorUseStatusName(DataTable p_Dt, string p_YarnFinishName, int p_MaxDayNum)
        {
            decimal   qty        = 0;
            decimal   leaveqty   = 0;
            string    sql        = string.Empty;
            string    statusname = string.Empty;
            DateTime  dtInTime;
            DataTable dt;

            foreach (DataRow dr in p_Dt.Rows)
            {
                if (p_YarnFinishName == dr["YarnStatusName"].ToString())             //已经完成了才处理相关状态
                {
                    dtInTime = DateTime.Now.Date;
                    leaveqty = 0;
                    qty      = SysConvert.ToDecimal(dr["HaveInQty"].ToString());             //已入库
                    sql      = "SELECT InDate,Qty FROM WH_Storge WHERE DtsSO=" + SysString.ToDBString(dr["CompactCode"].ToString()) + " AND ItemCode=" + SysString.ToDBString(dr["ItemCode"].ToString());
                    sql     += " AND ColorName=" + SysString.ToDBString(dr["ColorName"].ToString());
                    dt       = SysUtils.Fill(sql);
                    foreach (DataRow drStorge in dt.Rows)
                    {
                        dtInTime  = SysConvert.ToDateTime(drStorge["InDate"]);
                        leaveqty += SysConvert.ToDecimal(drStorge["Qty"]);
                    }

                    dr["LeaveQty"] = leaveqty;

                    if (leaveqty >= qty * 0.1m)                                 //库存剩余超过10%
                    {
                        if (dtInTime.AddDays(p_MaxDayNum) <= DateTime.Now.Date) //超过限制的天数了
                        {
                            statusname = ColorStatusName[1];
                        }
                        else                        //否则正常
                        {
                            statusname = ColorStatusName[0];
                        }
                    }
                    else                    //状态 已使用
                    {
                        statusname = ColorStatusName[2];
                    }
                }
                else                //正常
                {
                    statusname = ColorStatusName[0];
                }

                dr["UseStatusName"] = statusname;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                TestReportDts MasterEntity = (TestReportDts)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO WO_TestReportDts(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("ID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ",");
                MasterField.Append("MainID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.MainID) + ",");
                MasterField.Append("Seq" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Seq) + ",");
                MasterField.Append("TProject" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.TProject) + ",");
                MasterField.Append("EvaluationGrade" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.EvaluationGrade) + ",");
                MasterField.Append("Remark" + ")");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ")");



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                ItemPic MasterEntity = (ItemPic)p_Entity;
                if (MasterEntity.MainID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO Data_ItemPic(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("MainID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.MainID) + ",");
                MasterField.Append("Seq" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Seq) + ",");
                MasterField.Append("PicImage" + ",");
                MasterValue.Append(@"@PicImage" + ",");
                MasterField.Append("Remark" + ")");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ")");



                object[,] obja = new object[2, 1];
                obja[0, 0]     = "@PicImage";
                obja[1, 0]     = MasterEntity.PicImage;

                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString(), obja);
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString(), obja);
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                AddressList MasterEntity = (AddressList)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO Data_AddressList(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("ID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ",");
                MasterField.Append("DVendorID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.DVendorID) + ",");
                MasterField.Append("DVendorAttn" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.DVendorAttn) + ",");
                MasterField.Append("DVendorName" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.DVendorName) + ",");
                MasterField.Append("DelFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.DelFlag) + ",");
                MasterField.Append("SubmitFlag" + ")");
                MasterValue.Append(SysString.ToDBString(MasterEntity.SubmitFlag) + ")");



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //提交动作
            this.m_strSubmitAction = ProcessConstString.SubmitAction.ACTION_SUBMIT;

            switch (base.StepName)
            {
            case ProcessConstString.StepName.ReceiveStepName.STEP_PLOT:
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsDeny, false);
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsPlot, false);
                ViewBase l_objClerks     = OAUser.GetUserByRole(OUConstString.RoleName.PartysDocument);
                String   l_strClerkField = String.Empty;
                foreach (User user in l_objClerks.Ens)
                {
                    l_strClerkField += user.DomainUserID + ";";
                }
                l_strClerkField = SysString.TrimLastWord(l_strClerkField);
                l_htAttribute.Add(ConstString.CustomAttr.Receive.Clerks, l_strClerkField);
                break;

            case ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION:
                break;

            case ProcessConstString.StepName.ReceiveStepName.STEP_PROCESS_CENTER:
                //l_htAttribute.Add(ConstString.CustomAttr.Receive.IsPlot, false);
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignSection, false);
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignPeople, false);
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsDirectArchive, true);
                break;

            case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER:
                break;

            case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF:
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignSection, false);
                break;

            case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR:
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignSection, false);
                l_htAttribute.Add(ConstString.CustomAttr.Receive.IsAssignPeople, false);
                break;

            case ProcessConstString.StepName.ReceiveStepName.STEP_DISTRIBUTION:
                break;

            default:
                break;
            }

            base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false));
        }
        protected void btnSumitInspect_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;
            String        l_strInspector   = String.Empty;

            if (String.IsNullOrEmpty(ddlPoliticalOfficer.SelectedValue))
            {
                JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择党群工作处处长");
                return;
            }
            l_strInspector = ddlPoliticalOfficer.SelectedValue;

            //表单的合法性验证
            if (!VerifyField())
            {
                JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            //提交动作
            this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_INSPECT;

            if (String.IsNullOrEmpty(WorkItemID))
            {
                //流程创建时候设置自定义属性
                l_htAttribute.Add(ConstString.CustomAttr.Receive.Initiator, CurrentUserInfo.UserName);

                l_BusReceiveEdit    = new B_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID);

                if (l_BusReceiveEdit != null)
                {
                    l_BusReceiveEdit.ProcessID = base.ProcessID;
                    l_BusReceiveEdit.Save();
                }
            }

            ViewBase l_objClerks     = OAUser.GetUserByRole(OUConstString.RoleName.PartysDocument);
            String   l_strClerkField = String.Empty;

            foreach (User user in l_objClerks.Ens)
            {
                l_strClerkField += user.DomainUserID + ";";
            }
            l_strClerkField = SysString.TrimLastWord(l_strClerkField);

            l_htAttribute.Add(ConstString.CustomAttr.Receive.Officer, l_strInspector);
            l_htAttribute.Add(ConstString.CustomAttr.Receive.Clerks, l_strClerkField);

            base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                WHCalMethod MasterEntity = (WHCalMethod)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO Enum_WHCalMethod(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("ID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ",");
                MasterField.Append("Code" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Code) + ",");
                MasterField.Append("Name" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Name) + ",");
                MasterField.Append("Remark" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ",");
                MasterField.Append("FieldName" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.FieldName) + ",");
                MasterField.Append("DelFlag" + ")");
                MasterValue.Append(SysString.ToDBString(MasterEntity.DelFlag) + ")");



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                //if (SysConvert.ToString(drpVendorID.EditValue) == string.Empty)
                //{
                //    this.ShowMessage("请选择收货单位");
                //    drpVendorID.Focus();
                //    return;
                //}
                frmLoadFHForm frm = new frmLoadFHForm();
                frm.WL = true;
                string sql = string.Empty;
                sql += " AND SendCode+ItemCode+ColorNum+ColorName NOT IN(SELECT ISNULL(SendNo+ItemCode+ColorNum+ColorName,'') OrderFormNo FROM UV1_Attn_GoodsTransDts";

                if (saveNoLoadCheckDayNum != 0)
                {
                    sql += " WHERE MakeDate BETWEEN " + SysString.ToDBString(DateTime.Now.AddDays(0 - saveNoLoadCheckDayNum).ToString("yyyy-MM-dd")) + " AND " + SysString.ToDBString(DateTime.Now.ToString("yyyy-MM-dd"));
                }
                sql += ")";
                sql += " AND FormNo+ItemCode+ColorNum+ColorName NOT IN(SELECT ISNULL(SendNo+ItemCode+ColorNum+ColorName,'') OrderFormNo FROM UV1_Attn_GoodsTransDts";

                if (saveNoLoadCheckDayNum != 0)
                {
                    sql += " WHERE MakeDate BETWEEN " + SysString.ToDBString(DateTime.Now.AddDays(0 - saveNoLoadCheckDayNum).ToString("yyyy-MM-dd")) + " AND " + SysString.ToDBString(DateTime.Now.ToString("yyyy-MM-dd"));
                }
                sql += ")";
                frm.NoLoadCondition = sql;
                //frm.VendorID = SysConvert.ToString(drpVendorID.EditValue);
                frm.ShowDialog();
                string str = string.Empty;
                if (frm.FHFormID != null && frm.FHFormID.Length != 0)
                {
                    SetGridView1();
                    for (int i = 0; i < frm.FHFormID.Length; i++)
                    {
                        if (str != string.Empty)
                        {
                            str += ",";
                        }
                        str += SysConvert.ToString(frm.FHFormID[i]);
                    }
                    setItemNews(str);
                }
            }

            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 9
0
 private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
 {
     if (e.Column.FieldName == "SBitID")
     {
         string    SBitID = SysConvert.ToString(gridView1.GetRowCellValue(e.RowHandle, "SBitID"));
         string    sql    = "SELECT * FROM WH_SBit WHERE SBitID =" + SysString.ToDBString(SBitID);
         DataTable dt     = SysUtils.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             gridView1.SetRowCellValue(e.RowHandle, "WHID", SysConvert.ToString(dt.Rows[0]["WHID"]));
             gridView1.SetRowCellValue(e.RowHandle, "SectionID", SysConvert.ToString(dt.Rows[0]["SectionID"]));
         }
     }
 }
Exemplo n.º 10
0
        private void BindGrid()
        {
            string    sql   = "SELECT * FROM Sale_SaleOrderCapDts WHERE MainID=" + SysString.ToDBString(m_ID);
            DataTable dt    = SysUtils.Fill(sql);
            int       count = dt.Rows.Count;

            for (int i = 0; i < 5 - count; i++)
            {
                DataRow dr = dt.NewRow();
                dt.Rows.Add(dr);
            }
            gridView1.GridControl.DataSource = dt;
            gridView1.GridControl.Show();
        }
Exemplo n.º 11
0
        /// <summary>
        /// 根据条码得到图片
        /// </summary>
        /// <param name="p_Code"></param>
        /// <returns></returns>
        private byte[] GetPic(string p_Code)
        {
            string    sql = "SELECT GBPic FROM Data_ItemGB WHERE GBCode=" + SysString.ToDBString(p_Code);
            DataTable dt  = SysUtils.Fill(sql);

            if (dt.Rows.Count > 0)
            {
                return((byte[])dt.Rows[0]["GBPic"]);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void BindGrid()
        {
            string sql = " AND ItemTypeID=" + SysString.ToDBString(m_ItemType);

            if (ItemClassArray != "-1" && ItemClassArray != "")
            {
                sql += " AND ItemClassID IN(" + ItemClassArray + ")";
            }

            StorgeRule rule = new StorgeRule();

            gridView1.GridControl.DataSource = rule.RShow(sql + HTDataConditionStr, ProcessGrid.GetQueryField(gridView1).Replace("SelectFlag", "0 SelectFlag"));
            gridView1.GridControl.Show();
        }
Exemplo n.º 13
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void GetCondtion()
        {
            string tempStr = string.Empty;

            if (txtFormNo.Text.Trim() != "")
            {
                tempStr += " AND FormNo LIKE " + SysString.ToDBString("%" + txtFormNo.Text.Trim() + "%");
            }

            if (chkQMakeDate.Checked)
            {
                tempStr += " AND FormDate BETWEEN " + SysString.ToDBString(txtQMakeDateB.DateTime) + " AND " + SysString.ToDBString(txtQMakeDateE.DateTime);
            }

            if (SysConvert.ToString(drpSaleOPID.EditValue) != "")
            {
                tempStr += " AND SaleOPID=" + SysString.ToDBString(SysConvert.ToString(drpSaleOPID.EditValue));
            }

            if (SysConvert.ToString(drpTrackOPID.EditValue) != "")
            {
                tempStr += " AND TrackOPID=" + SysString.ToDBString(SysConvert.ToString(drpTrackOPID.EditValue));
            }

            if (txtItemCode.Text.Trim() != "")
            {
                tempStr += " AND ItemCode LIKE " + SysString.ToDBString("%" + txtItemCode.Text.Trim() + "%");
            }

            if (txtItemModel.Text.Trim() != "")
            {
                tempStr += " AND ItemModel LIKE " + SysString.ToDBString("%" + txtItemModel.Text.Trim() + "%");
            }

            if (txtColorName.Text.Trim() != "")
            {
                tempStr += " AND ColorName LIKE " + SysString.ToDBString("%" + txtColorName.Text.Trim() + "%");
            }

            if (txtFlower.Text.Trim() != "")
            {
                tempStr += " AND Flower LIKE " + SysString.ToDBString("%" + txtFlower.Text.Trim() + "%");
            }
            if (ID > 0)
            {
                tempStr += " AND MainID=" + SysString.ToDBString(ID);
            }

            HTDataConditionStr = tempStr;
        }
Exemplo n.º 14
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void GetCondtion()
        {
            string tempStr = string.Empty;

            if (txtCode.Text.Trim() != "")
            {
                tempStr += " AND Code LIKE" + SysString.ToDBString("%" + txtCode.Text.Trim() + "%");
            }
            if (txtName.Text.Trim() != "")
            {
                tempStr += " AND Name LIKE" + SysString.ToDBString("%" + txtName.Text.Trim() + "%");
            }
            HTDataConditionStr = tempStr;
        }
Exemplo n.º 15
0
        private string GetCSItem(int p_CSID)
        {
            string    sql = "SELECT Name FROM Data_CSBGItem WHERE ID=" + SysString.ToDBString(p_CSID);
            DataTable dt  = SysUtils.Fill(sql);

            if (dt.Rows.Count > 0)
            {
                return(SysConvert.ToString(dt.Rows[0][0]));
            }
            else
            {
                return("");
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 获得查询条件
        /// </summary>
        private void GetCondition2()
        {
            string outstr = string.Empty;

            if (saveWHID == string.Empty)
            {
                outstr += " AND WHID IN(SELECT WHID FROM WH_WH WHERE WHTypeID=" + saveWHTypeID + ")";
            }
            else
            {
                outstr += " AND WHID=" + SysString.ToDBString(saveWHID);
            }
            conditionstr2 = outstr;
        }
Exemplo n.º 17
0
        private void GetItemLabel(string GBCode)
        {
            string    sql = "SELECT * FROM UV1_Data_ItemGB WHERE GBCode=" + SysString.ToDBString(GBCode);
            DataTable dt  = SysUtils.Fill(sql);

            if (dt.Rows.Count > 0)
            {
                lbItemCode.Text  = SysConvert.ToString(dt.Rows[0]["ItemCode"]);
                lbGoodsCode.Text = SysConvert.ToString(dt.Rows[0]["GoodsCode"]);
                lbVendorID.Text  = SysConvert.ToString(dt.Rows[0]["VendorID"]);
                lbColorNum.Text  = SysConvert.ToString(dt.Rows[0]["ColorNum"]);
                lbColorName.Text = SysConvert.ToString(dt.Rows[0]["ColorName"]);
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                ItemBaseCheckItem MasterEntity = (ItemBaseCheckItem)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO Data_ItemBaseCheckItem(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("ID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ",");
                MasterField.Append("Code" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Code) + ",");
                MasterField.Append("Name" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Name) + ",");
                MasterField.Append("CLSA" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.CLSA) + ",");
                MasterField.Append("CLSB" + ")");
                MasterValue.Append(SysString.ToDBString(MasterEntity.CLSB) + ")");



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E);
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Update(BaseEntity p_Entity)
        {
            try
            {
                ItemAdd MasterEntity = (ItemAdd)p_Entity;
                if (MasterEntity.MainID == 0)
                {
                    return(0);
                }

                //更新主表数据
                StringBuilder UpdateBuilder = new StringBuilder();
                UpdateBuilder.Append("UPDATE Data_ItemAdd SET ");
                UpdateBuilder.Append(" MainID=" + SysString.ToDBString(MasterEntity.MainID) + ",");
                UpdateBuilder.Append(" Seq=" + SysString.ToDBString(MasterEntity.Seq) + ",");
                UpdateBuilder.Append(" Name=" + SysString.ToDBString(MasterEntity.Name) + ",");
                UpdateBuilder.Append(" FiledName=" + SysString.ToDBString(MasterEntity.FiledName) + ",");
                UpdateBuilder.Append(" Value=" + SysString.ToDBString(MasterEntity.Value) + ",");
                UpdateBuilder.Append(" DRemark=" + SysString.ToDBString(MasterEntity.DRemark) + ",");
                UpdateBuilder.Append(" FiledSetID=" + SysString.ToDBString(MasterEntity.FiledSetID) + ",");
                UpdateBuilder.Append(" FormID=" + SysString.ToDBString(MasterEntity.FormID) + ",");
                UpdateBuilder.Append(" FormAID=" + SysString.ToDBString(MasterEntity.FormAID) + ",");
                UpdateBuilder.Append(" FormBID=" + SysString.ToDBString(MasterEntity.FormBID));

                UpdateBuilder.Append(" WHERE " + "MainID=" + SysString.ToDBString(MasterEntity.MainID) + " AND Seq=" + SysString.ToDBString(MasterEntity.Seq));



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBUpdate), E);
            }
        }
Exemplo n.º 20
0
        /// <summary>
        /// 脚本回传
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            String strIds   = String.Empty;
            String strNos   = String.Empty;
            String strNames = String.Empty;

            //if (UCIsSingle)
            //{
            //    strIds = this.gvCompany.SelectedKey;
            //}
            //else
            //{
            //strIds = SysString.GetStringFormatForList(this.gvCompany.SelectedKeys, ",");
            strNames = SysString.GetStringFormatForList(this.msExoticCompanyList.SelectedValues, ";");
            //}
            //vb = OADept.GetCompany(this.ddlType.SelectedIndex + 1, this.txtSearchText.Text.Trim());
            //if (String.IsNullOrEmpty(strIds) == false)
            //{
            //    if (vb != null)
            //    {
            //        vb.Condition = "a.ID in (" + strIds + ")";
            //        strIds = vb.GetFieldVals("ID", ";");
            //        strNos = vb.GetFieldVals("No", ";");
            //        strNames = vb.GetFieldVals("Name", ";");
            //    }
            //}

            String strScript = String.Empty;

            //if (this.UCIDControl != String.Empty)
            //{
            //    strScript += base.GetJSscriptValue(this.UCIDControl, strIds);
            //}

            //if (this.UCNoControl != String.Empty)
            //{
            //    strScript += base.GetJSscriptValue(this.UCNoControl, strNos);
            //    strScript += base.GetJSscriptTitle(this.UCNoControl, strNames);
            //}

            if (this.UCNameControl != String.Empty)
            {
                strScript += base.GetJSscriptValue(this.UCNameControl, strNames);
                strScript += base.GetJSscriptTitle(this.UCNameControl, strNos);
            }
            strScript += String.Format("parent.ClosePopDiv('{0}')", base.divPopDivID + base.UCID);
            //组成一整条js后运行
            ClientScriptM.ResponseScript(this, strScript);
        }
Exemplo n.º 21
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Update(BaseEntity p_Entity)
        {
            try
            {
                SaleProcedure MasterEntity = (SaleProcedure)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //更新主表数据
                StringBuilder UpdateBuilder = new StringBuilder();
                UpdateBuilder.Append("UPDATE Enum_SaleProcedure SET ");
                UpdateBuilder.Append(" ID=" + SysString.ToDBString(MasterEntity.ID) + ",");
                UpdateBuilder.Append(" Code=" + SysString.ToDBString(MasterEntity.Code) + ",");
                UpdateBuilder.Append(" Name=" + SysString.ToDBString(MasterEntity.Name) + ",");
                UpdateBuilder.Append(" ShowFlag=" + SysString.ToDBString(MasterEntity.ShowFlag) + ",");
                UpdateBuilder.Append(" Remark=" + SysString.ToDBString(MasterEntity.Remark) + ",");
                UpdateBuilder.Append(" JGUseFlag=" + SysString.ToDBString(MasterEntity.JGUseFlag) + ",");
                UpdateBuilder.Append(" JGItemTypeID=" + SysString.ToDBString(MasterEntity.JGItemTypeID) + ",");
                UpdateBuilder.Append(" JGWHIDDefault=" + SysString.ToDBString(MasterEntity.JGWHIDDefault) + ",");
                UpdateBuilder.Append(" JGFormListID=" + SysString.ToDBString(MasterEntity.JGFormListID) + ",");
                UpdateBuilder.Append(" PackCheckFlag=" + SysString.ToDBString(MasterEntity.PackCheckFlag));

                UpdateBuilder.Append(" WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID));



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBUpdate), E);
            }
        }
Exemplo n.º 22
0
 /// <summary>
 /// 更新表单设置的值
 /// </summary>
 /// <param name="p_ID"></param>
 /// <param name="p_TableName"></param>
 /// <param name="p_FiledName"></param>
 /// <param name="p_Value"></param>
 /// <param name="sqlTrans"></param>
 public void UpdateFiledSet(int p_ID, int p_FiledSetID, string p_Value, IDBTransAccess sqlTrans)
 {
     try
     {
         FiledSet entity = new FiledSet(sqlTrans);
         entity.ID = p_FiledSetID;
         entity.SelectByID();
         string sql = "";
         if (entity.UpDateFlag == 1) //更新标志
         {
             if (entity.FiledType == "string")
             {
                 sql  = "Update " + entity.MainTable;
                 sql += " Set " + entity.FiledName + "=" + SysString.ToDBString(SysConvert.ToString(p_Value));
                 sql += " where ID=" + p_ID;
                 sqlTrans.ExecuteNonQuery(sql);
             }
             if (entity.FiledType == "decimal")
             {
                 sql  = "Update " + entity.MainTable;
                 sql += " Set " + entity.FiledName + "=" + SysString.ToDBString(SysConvert.ToDecimal(p_Value));
                 sql += " where ID=" + p_ID;
                 sqlTrans.ExecuteNonQuery(sql);
             }
             if (entity.FiledType == "int")
             {
                 sql  = "Update " + entity.MainTable;
                 sql += " Set " + entity.FiledName + "=" + SysString.ToDBString(SysConvert.ToInt32(p_Value));
                 sql += " where ID=" + p_ID;
                 sqlTrans.ExecuteNonQuery(sql);
             }
             if (entity.FiledType == "datetime")
             {
                 sql  = "Update " + entity.MainTable;
                 sql += " Set " + entity.FiledName + "=" + SysString.ToDBString(SysConvert.ToDateTime(p_Value));
                 sql += " where ID=" + p_ID;
                 sqlTrans.ExecuteNonQuery(sql);
             }
         }
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Exemplo n.º 23
0
        /// <summary>
        /// 查询条件
        /// </summary>
        public override void GetCondtion()
        {
            string tempStr = string.Empty;

            if (txtVendorID.Text.Trim() != "")
            {
                tempStr += " AND VendorID LIKE " + SysString.ToDBString("%" + txtVendorID.Text.Trim() + "%");
            }
            if (txtGoodsCode.Text.Trim() != "")
            {
                tempStr += " AND GoodsCode LIKE " + SysString.ToDBString("%" + txtGoodsCode.Text.Trim() + "%");
            }
            if (txtColorNum.Text.Trim() != "")
            {
                tempStr += " AND ColorNum LIKE " + SysString.ToDBString("%" + txtColorNum.Text.Trim() + "%");
            }
            if (txtItemCode.Text.Trim() != "")
            {
                tempStr += " AND ItemCode LIKE " + SysString.ToDBString("%" + txtItemCode.Text.Trim() + "%");
            }
            if (txtMLDL.Text.Trim() != "")
            {
                tempStr += " AND MLDLCode LIKE " + SysString.ToDBString("%" + txtMLDL.Text.Trim() + "%");
            }
            if (txtMLLB.Text.Trim() != "")
            {
                tempStr += " AND MLLBCode LIKE " + SysString.ToDBString("%" + txtMLLB.Text.Trim() + "%");
            }
            if (txtItemName.Text.Trim() != "")
            {
                tempStr += " AND ItemName LIKE " + SysString.ToDBString("%" + txtItemName.Text.Trim() + "%");
            }
            if (txtMWeightS.Text.Trim() != "")
            {
                tempStr += " AND MWeight> " + SysString.ToDBString(SysConvert.ToDecimal(txtMWeightS.Text.Trim()));
            }
            if (txtMWeightE.Text.Trim() != "")
            {
                tempStr += " AND MWeight< " + SysString.ToDBString(SysConvert.ToDecimal(txtMWeightE.Text.Trim()));
            }

            if (txtGBCode.Text.Trim() != "")
            {
                tempStr += " AND GBCode LIKE " + SysString.ToDBString("%" + txtGBCode.Text.Trim() + "%");
            }
            tempStr           += " AND UseableFlag=1";
            tempStr           += " ORDER BY GBDate DESC";
            HTDataConditionStr = tempStr;
        }
Exemplo n.º 24
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Update(BaseEntity p_Entity)
        {
            try
            {
                ReportManageDts MasterEntity = (ReportManageDts)p_Entity;
                if (MasterEntity.MainID == 0)
                {
                    return(0);
                }

                //更新主表数据
                StringBuilder UpdateBuilder = new StringBuilder();
                UpdateBuilder.Append("UPDATE Data_ReportManageDts SET ");
                UpdateBuilder.Append(" MainID=" + SysString.ToDBString(MasterEntity.MainID) + ",");
                UpdateBuilder.Append(" Seq=" + SysString.ToDBString(MasterEntity.Seq) + ",");
                UpdateBuilder.Append(" DataSourceName=" + SysString.ToDBString(MasterEntity.DataSourceName) + ",");
                UpdateBuilder.Append(" SqlName=" + SysString.ToDBString(MasterEntity.SqlName) + ",");
                UpdateBuilder.Append(" SqlStr=" + SysString.ToDBString(MasterEntity.SqlStr) + ",");
                UpdateBuilder.Append(" QueryName=" + SysString.ToDBString(MasterEntity.QueryName) + ",");
                UpdateBuilder.Append(" OrderCondition=" + SysString.ToDBString(MasterEntity.OrderCondition) + ",");
                UpdateBuilder.Append(" Remark=" + SysString.ToDBString(MasterEntity.Remark) + ",");
                UpdateBuilder.Append(" SqlFlag=" + SysString.ToDBString(MasterEntity.SqlFlag) + ",");
                UpdateBuilder.Append(" SourceType=" + SysString.ToDBString(MasterEntity.SourceType));

                UpdateBuilder.Append(" WHERE " + "MainID=" + SysString.ToDBString(MasterEntity.MainID) + " AND Seq=" + SysString.ToDBString(MasterEntity.Seq));



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)EnumMessage.CommonDBUpdate), E);
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void BindGrid()
        {
            string sql = " AND ItemTypeID=" + SysString.ToDBString((int)EnumItemType.面料);

            if (ItemClassArray != "-1" && ItemClassArray != "")
            {
                sql += " AND ItemClassID IN(" + ItemClassArray + ")";
            }
            ItemRule  rule = new ItemRule();
            DataTable dt   = rule.RShow(sql + HTDataConditionStr + " ORDER BY ItemCode DESC", ProcessGrid.GetQueryField(gridView1).Replace(",GBPic2", ""));//GBPic2 重新单独处理获得;

            BindProcPicture(dt);
            gridView1.GridControl.DataSource = dt;
            gridView1.GridControl.Show();
        }
Exemplo n.º 26
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void GetCondtion()
        {
            string tempStr = string.Empty;

            if (txtVendorID.Text.Trim() != "")
            {
                tempStr += " AND DVendorID LIKE " + SysString.ToDBString("%" + txtVendorID.Text.Trim() + "%");
            }
            if (SysConvert.ToInt32(drpDHID.EditValue) != 0)
            {
                tempStr += " AND DataDHID=" + SysString.ToDBString(SysConvert.ToInt32(drpDHID.EditValue));
            }

            HTDataConditionStr = tempStr;
        }
Exemplo n.º 27
0
        /// <summary>
        /// 绑定仓库位
        /// </summary>
        private void BindGridSBit()
        {
            if (gridView1.RowCount > 0)
            {
                SBitRule rule = new SBitRule();
                string   Str  = string.Empty;
                Str  = " AND WHID=" + SysString.ToDBString(txtWHID.Text.Trim());
                Str += " AND SectionID=" + SysString.ToDBString(SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SectionID")));
                gridView3.GridControl.DataSource = rule.RShow(Str, ProcessGrid.GetQueryField(gridView3));

                gridView3.GridControl.Show();
                txtWHIDBit.Text      = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "WHID"));
                txtSectionIDBit.Text = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SectionID"));
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// 根据FormListAID得到顶层单据类型入库、出库、盘点、移库、形态转换、期初入库
        /// </summary>
        /// <param name="p_FormListAID">loginID</param>
        /// <returns></returns>
        public static int GetFormListTopTypeByFormListID(int p_FormListAID, IDBTransAccess sqlTrans)
        {
            int       outint = p_FormListAID;
            string    sql    = "SELECT ParentID FROM Enum_FormList WHERE ID=" + SysString.ToDBString(p_FormListAID);
            DataTable dt     = sqlTrans.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                if (SysConvert.ToInt32(dt.Rows[0]["ParentID"]) != 0)
                {
                    outint = SysConvert.ToInt32(dt.Rows[0]["ParentID"]);
                }
            }
            return(outint);
        }
Exemplo n.º 29
0
		/// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                ItemGYFlowDts MasterEntity=(ItemGYFlowDts)p_Entity;
                if (MasterEntity.ID==0)
                {
                    return 0;
                }

                //新增主表数据
                StringBuilder MasterField=new StringBuilder();
                StringBuilder MasterValue=new StringBuilder();
                MasterField.Append("INSERT INTO Data_ItemGYFlowDts(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("ID"+","); 
  				MasterValue.Append(SysString.ToDBString(MasterEntity.ID)+","); 
  				MasterField.Append("MainID"+","); 
  				MasterValue.Append(SysString.ToDBString(MasterEntity.MainID)+","); 
  				MasterField.Append("Seq"+","); 
  				MasterValue.Append(SysString.ToDBString(MasterEntity.Seq)+","); 
  				MasterField.Append("ItemGYTypeID"+")"); 
  				MasterValue.Append(SysString.ToDBString(MasterEntity.ItemGYTypeID)+")"); 
 
                
                

                //执行
                int AffectedRows=0;
				if(!this.sqlTransFlag)
				{
					AffectedRows=this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
				}
				else
				{
					AffectedRows=sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
				}
                return AffectedRows;
            }
            catch(BaseException E)
            {
                throw new BaseException(E.Message,E);
            }
            catch(Exception E)
            {
               throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert),E);
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Update(BaseEntity p_Entity)
        {
            try
            {
                VendorInvoiceDts MasterEntity = (VendorInvoiceDts)p_Entity;
                if (MasterEntity.MainID == 0)
                {
                    return(0);
                }

                //更新主表数据
                StringBuilder UpdateBuilder = new StringBuilder();
                UpdateBuilder.Append("UPDATE Data_VendorInvoiceDts SET ");
                UpdateBuilder.Append(" MainID=" + SysString.ToDBString(MasterEntity.MainID) + ",");
                UpdateBuilder.Append(" Seq=" + SysString.ToDBString(MasterEntity.Seq) + ",");
                UpdateBuilder.Append(" CompName=" + SysString.ToDBString(MasterEntity.CompName) + ",");
                UpdateBuilder.Append(" TaxNo=" + SysString.ToDBString(MasterEntity.TaxNo) + ",");
                UpdateBuilder.Append(" Address=" + SysString.ToDBString(MasterEntity.Address) + ",");
                UpdateBuilder.Append(" Tel=" + SysString.ToDBString(MasterEntity.Tel) + ",");
                UpdateBuilder.Append(" Bank=" + SysString.ToDBString(MasterEntity.Bank) + ",");
                UpdateBuilder.Append(" No=" + SysString.ToDBString(MasterEntity.No) + ",");
                UpdateBuilder.Append(" DRemark=" + SysString.ToDBString(MasterEntity.DRemark));

                UpdateBuilder.Append(" WHERE " + "MainID=" + SysString.ToDBString(MasterEntity.MainID) + " AND Seq=" + SysString.ToDBString(MasterEntity.Seq));



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBUpdate), E);
            }
        }