/// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName  = "Buy_ItemBuyForm";
            this.HTDataDts        = gridView1;
            this.HTCheckDataField = new string[] { "ItemCode", "Qty" };//数据明细校验必须录入字段
            //Common.BindPayMethod(drpPayMothodFlag, true);
            //Common.BindVendor(drpVendorID, new int[] { (int)EnumVendorType.工厂,(int)EnumVendorType.供应商 }, true);
            new VendorProc(drpVendorID);
            //Common.BindEnumUnit(restxtunit, true);

            //Common.BindCLS(restxtunit, "Data_Item", "ItemUnitFab", true);
            //Common.BindOP(drpSaleOPID, true);
            //Common.BindOP(drpCGOPID, true);
            //this.ToolBarItemAdd(28, ToolButtonName.btnLoad.ToString(), "加载", false, btnLoad_Click);
            this.ToolBarItemAdd(29, ToolButtonName.btnLoad.ToString(), "加载产品", false, btnDevItemLoad_Click);
            ParamSetRule psrule = new ParamSetRule();

            saveNoLoadCheckDayNum = psrule.RShowIntByCode((int)ParamSetEnum.未加载数据比对天数);
            this.ToolBarItemAdd(28, ToolButtonName.btnLoad.ToString(), "加载订单", false, btnLoadSO_Click);
            //this.ToolBarItemAdd(28, ToolButtonName.btnLoad.ToString(), "加载订单算料", false, btnLoad_Click);

            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5009)))//面料的坯布启用可替换坯布功能,影响到订单坯布算料、坯布采购、织造等
            {
                gridView1.Columns["ItemCode"].ColumnEdit = drpGridItemCode;
                gridViewBaseRowChangedA1 += new gridViewBaseRowChangedA(gridViewRowChanged1);//绑定GridView1事件
                gridViewBindEventA1(gridView1);
                this.gridView1.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gridView1_CellValueChanged);
            }
        }
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName = "Data_Item";
            this.HTDataDts       = gridView6;
            this.HTDataDtsAttach = new DevExpress.XtraGrid.Views.Grid.GridView[] { gridView2, gridView3, gridView6 };



            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5010)))//面料定义界面不要显示原料信息管理内容
            {
                xtraTabPage2.PageVisible = false;
            }


            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5012)))//
            {
                btnCalc.Visible = true;
            }



            SetTabIndex(0, groupControlMainten);


            //txtItemCode.Properties.ReadOnly = true;

            Common.BindCLS(txtWeightUnit, "Data_Item", "WeightUnit", true);

            Common.BindCLS(txtMFUnit, "Data_Item", "MFUnit", true);



            gridViewBaseRowChangedA3 += new gridViewBaseRowChangedA(gridViewRowChanged3);
            gridViewBindEventA3(gridView6);
        }
Beispiel #3
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 (txtSendCode.Text.Trim() != "")//查询d
            {
                tempStr = " AND SendCode LIKE " + SysString.ToDBString("%" + txtSendCode.Text.Trim() + "%");
            }

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

            if (ChkSendDate.Checked)
            {
                tempStr += " AND MakeDate BETWEEN " + SysString.ToDBString(txtQMakeDateS.DateTime) + " AND " + SysString.ToDBString(txtQMakeDateE.DateTime);
            }

            if (SysConvert.ToString(drpSaleOPID.EditValue) != "")
            {
                tempStr += " AND SaleOPID  =" + SysString.ToDBString(drpSaleOPID.EditValue.ToString());
            }
            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5430)) && !FParamConfig.LoginHTFlag)//销售订单业务员只查看自己的的订单
            {
                tempStr += " AND SaleOPID IN(" + WCommon.GetStructureMemberOPStr() + ")";
            }

            if (txtItemCode.Text.Trim() != "")
            {
                tempStr += " AND ItemCode LIKE" + SysString.ToDBString("%" + txtItemCode.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 (txtColorName.Text.Trim() != "")
            {
                tempStr += " AND ColorName LIKE " + SysString.ToDBString("%" + txtColorName.Text.Trim() + "%");
            }
            if (SysConvert.ToInt32(drpFHTypeID.EditValue) != 0)
            {
                tempStr += " AND FHTypeID=" + SysString.ToDBString(SysConvert.ToInt32(drpFHTypeID.EditValue));
            }

            tempStr           += " ORDER BY FormNo DESC";
            HTDataConditionStr = tempStr;
        }
Beispiel #4
0
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName = "Sale_SaleOrder";
            this.HTDataList      = gridView1;
            Common.BindOrderType(drpOrderTypeID, true);
            Common.BindOrderLevel(drpOrderLevelID, true);
            txtOrderDateS.DateTime = DateTime.Now.AddMonths(-2).Date;
            txtOrderDateE.DateTime = DateTime.Now.Date;
            txtReqDateS.DateTime   = DateTime.Now.AddMonths(-1).Date;
            txtReqDateE.DateTime   = DateTime.Now.Date;
            Common.BindVendor(drpVendorID, new int[] { (int)EnumVendorType.客户 }, true);
            new VendorProc(drpVendorID);

            if (ProductParamSet.GetIntValueByID(5417) == (int)YesOrNo.Yes)//组织结构体系启用
            {
                chkOrderDate.Checked = false;
            }


            drpVendorID.EditValue = m_VendorID;

            if (m_NoLoadCondition != string.Empty)//如果有未加载语句则显示查询类型
            {
                drpQueryType.Visible = true;
            }
            btnQuery_Click(null, null);
        }
Beispiel #5
0
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName  = "Dev_ColorCard";
            this.HTDataDts        = gridView1;
            this.HTCheckDataField = new string[] { "ItemCode" };//数据明细校验必须录入字段
            Common.BindVendor(drpVendorID, new int[] { (int)EnumVendorType.客户 }, true);
            Common.BindVendor(drpShopID, new int[] { (int)EnumVendorType.工厂, (int)EnumVendorType.染厂, (int)EnumVendorType.其他加工厂 }, true);

            if (ProductParamSet.GetIntValueByID(5020) == (int)YesOrNo.Yes)//组织结构体系启用
            {
                Common.BindOPID(drpSaleOPID, "Sale_SaleOrder", "SaleOPID", true);
            }
            else
            {
                Common.BindOPID(drpSaleOPID, true);
            }

            Common.BindOP(drpGYOPID, true);

            Common.BindColorSampleType(drpSampleType, true);
            new PopContainerUtil(chkFirstLightSource, Common.BindLightSource);   //主灯光源
            new PopContainerUtil(chkSencondLightSource, Common.BindLightSource); //副灯光源

            this.ToolBarItemAdd(28, "btnkLoadItem", "加载产品", false, btnkLoadItem_Click);
        }
Beispiel #6
0
        /// <summary>
        /// 加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void btnCPLoad_Click(object sender, EventArgs e)
        {
            try
            {
                if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
                {
                    frmLoadFabric frm = new frmLoadFabric();
                    frm.SelectItemType = SysConvert.ToInt32(ProductParamSet.GetIntValueByID(5413)); //0:表示只支持加载产品  1:表示只支持选择加载产品或者坯布  2:表示坯布


                    frm.ShowDialog();
                    string str = string.Empty;
                    if (frm.GBID != null && frm.GBID.Length != 0)
                    {
                        for (int i = 0; i < frm.GBID.Length; i++)
                        {
                            if (str != string.Empty)
                            {
                                str += ",";
                            }
                            str += SysConvert.ToString(frm.GBID[i]);
                        }
                        setCPItemNews(str);
                    }
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Beispiel #7
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 (txtSO.Text.Trim() != "")
            {
                tempStr += " AND SO LIKE " + SysString.ToDBString("%" + txtSO.Text.Trim() + "%");
            }

            if (SysConvert.ToString(drpSaleOPID.EditValue) != "")
            {
                tempStr += " AND SaleOPID = " + SysString.ToDBString(SysConvert.ToString(drpSaleOPID.EditValue));
            }
            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5430)) && !FParamConfig.LoginHTFlag)//销售订单业务员只查看自己的的订单
            {
                tempStr += " AND SaleOPID IN(" + WCommon.GetStructureMemberOPStr() + ")";
            }

            if (SysConvert.ToString(drpVendorID.EditValue) != "")
            {
                tempStr += " AND VendorID = " + SysString.ToDBString(SysConvert.ToString(drpVendorID.EditValue));
            }
            HTDataConditionStr = tempStr;
        }
Beispiel #8
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void BindGrid()
        {
            SaleOrderRule rule = new SaleOrderRule();
            DataTable     dt   = rule.RShowDts(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1).Replace("FormStatusName", "'' FormStatusName").Replace("ReceiveAmount", "0.0 ReceiveAmount"));

            SaleOrderStatusProc.ProcColorStatusName(dt);
            ProcDataSourceQty(dt);
            gridView1.GridControl.DataSource = dt;
            gridView1.GridControl.Show();

            string sql = "SELECT COUNT( ID)  FROM UV1_Sale_SaleOrderDts WHERE 1=1";

            sql += HTDataConditionStr + " GROUP BY ID";
            DataTable dtSO = SysUtils.Fill(sql);

            if (dtSO.Rows.Count > 0)
            {
                lbCount.Text = "销售合同数:" + dtSO.Rows[0][0].ToString();
            }
            else
            {
                lbCount.Text = "销售合同数:0";
            }

            if (ProductParamSet.GetIntValueByID(5418) == (int)YesOrNo.Yes)//更新回签标志
            {
                sql = "UPDATE Sale_SaleOrder SET HQFlag=1 WHERE FormNo IN (SELECT  ISNULL(FileProt2,'') FROM Data_WinListAttachFile WHERE FileProt1=" + SysString.ToDBString(this.Text) + ")";
                SysUtils.ExecuteNonQuery(sql);
            }
        }
        /// <summary>
        /// 新增初始化
        /// </summary>
        public override void IniInsertSet()
        {
            //txtWeightUnit.Text = "g/m";



            drpUseable.EditValue = 1;

            txtItemDate.DateTime = DateTime.Now.Date;


            drpItemUnit.Text = ProductParamSet.GetStrValueByID(5001);//面料默认单位设置


            txtColorLoss.Text = ProductParamSet.GetStrValueByID(5006); //默认染损
            txtLastLoss.Text  = ProductParamSet.GetStrValueByID(5007); //默认整理损


            if (ProductParamSet.GetIntValueByID(5022) == 1)//面料编码生成规格
            {
                txtItemCode_DoubleClick(null, null);
            }

            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5011)))//面料定义界面不要显示原料信息管理内容
            {
                txtWeightUnit.Text = SysConvert.ToString(ProductParamSet.GetStrValueByID(5011));
            }
            //iniFiledSet();
        }
Beispiel #10
0
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName   = "Buy_ItemBuyForm";
            this.HTDataList        = gridView1;
            this.HTQryContainer    = groupControlQuery;
            txtOrderDateS.DateTime = DateTime.Now.AddMonths(-1).Date;
            txtOrderDateE.DateTime = DateTime.Now.Date;
            txtReqDateS.DateTime   = DateTime.Now.AddMonths(-1).Date;
            txtReqDateE.DateTime   = DateTime.Now.Date;

            if (ItemBuyStatusProc.ColorIniFlag)
            {
                //ItemBuyStatusProc.ColorIniTextBox(new TextBox[] { txtColorSOStatus1, txtColorSOStatus2, txtColorSOStatus3, txtColorSOStatus4, txtColorSOStatus5 });

                ucStatusBarStand1.UCDataSource = ItemBuyStatusProc.ColorStatusDt;
                ucStatusBarStand1.UCAct();
            }
            Common.BindVendor(drpVendorID, new int[] { (int)EnumVendorType.供应商 }, true);
            ParamSetRule psrule = new ParamSetRule();

            saveNoLoadCheckDayNum = psrule.RShowIntByCode((int)ParamSetEnum.未加载数据比对天数);
            this.ToolBarItemAdd(32, "btnUpdateOrderStatus", "修改合同状态", true, UpdateOrderStatusToolStripMenuItem_Click, eShortcut.F9);

            if (ProductParamSet.GetIntValueByID(5020) == (int)YesOrNo.Yes)//组织结构体系启用
            {
                Common.BindOPID(drpSaleOPID, "Sale_SaleOrder", "SaleOPID", true);
            }
            else
            {
                Common.BindOPID(drpSaleOPID, true);
            }
        }
Beispiel #11
0
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName  = "Data_Item";
            this.HTDataDts        = gridView1;
            this.HTCheckDataField = new string[] { "DtsItemCode" };//数据明细校验必须录入字段
            Common.BindCLS(drpItemUnit, "Data_Item", "ItemUnitYarn", true);
            Common.BindCLS(drpItemrSeason, "Data_Item", "Season", true);
            Common.BindCLS(drpItemCW, "Data_Item", "ItemCW", true);
            Common.BindOP(drpCYOPID, (int)EnumOPDep.业务部, true);


            Common.BindItemClass(drpItemType, this.FormListAID, true);//绑定物品分类
            Common.BindVendor(drpBuyShopID, new int[] { (int)EnumVendorType.供应商 }, true);
            this.SetPosCondition = " AND ItemTypeID=" + this.FormListAID;
            new VendorProc(drpBuyShopID);

            new ItemProcResLookUP(BaseFocusLabel, gridView1, new string[3] {
                "DtsItemCode", "DtsItemName", "DtsItemStd"
            }, drpDtsItemCode, txtDtsItemName, new int[] { (int)EnumItemType.纱线, (int)EnumItemType.原料 }, "", "DtsItemModel", true, true);


            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5024)))//明细列表显示
            {
                groupControl1.Visible = true;
            }
            else
            {
                groupControl1.Visible = false;
            }


            SetTabIndex(0, groupControlMainten);
        }
        /// <summary>
        /// 初始化刷新数据(窗体加载时或用户刷新按钮时调用)
        /// </summary>
        public override void IniRefreshData()
        {
            Common.BindOrderType(drpOrderTypeID, true);
            Common.BindOrderLevel(drpOrderLevelID, true);
            Common.BindWLAmount(drpWLAmountType, true);
            Common.BindPayMethod(drpPayMothodFlag, true);
            //Common.BindOP(drpSaleOPID, (int)EnumOPDep.业务部, true);
            if (ProductParamSet.GetIntValueByID(5020) == (int)YesOrNo.Yes)//组织结构体系启用
            {
                Common.BindOPID(drpSaleOPID, "Sale_SaleOrder", "SaleOPID", true);
            }
            else
            {
                Common.BindOPID(drpSaleOPID, true);
            }
            Common.BindVendor(drpVendorID, new int[] { (int)EnumVendorType.客户 }, true);
            Common.BindVendor(drpDyeFactorty, new int[] { (int)EnumVendorType.染厂 }, true);
            Common.BindCLS(txtSGReq, "WO_FabricProcess", "SGReq", true);    //手感要求
            Common.BindSOContext(drpSOContext, "", true);
            Common.BindCLS(drpPackMethod, "WO_FabricProcess", "PackMethod", true);
            Common.BindCLS(drpAfterFinish, "WO_FabricProcess", "AfterFinish", true);
            Common.BindCLS(drpGridCalUnit, "WO_FabricProcessDts", "CalUnit", true);
            Common.BindCLS(restxtunit, "Data_Item", "ItemUnitFab", true);

            Common.BindCLS(drpShipMethod, "WO_FabricProcess", "ShipMethod", true);//运输方式
        }
Beispiel #13
0
        private void CalcQty(BProductCheckDts entity)
        {
            //==entity.KF25=1 开匹后新增加条码,entity.KF20 = 1,被开匹过的条码
            if (entity.KF25 != 1 && entity.KF20 != 1)     //不是开匹的才计算
            {
                entity.KF    = entity.RCKF + entity.ZCKF; //合计扣分=织疵点+染疵点
                entity.Qty   = entity.SM - entity.CJRC - entity.CJZC - entity.FMZC - entity.FMRC - entity.CY - entity.MQty3;
                entity.MQty4 = entity.SM - entity.CJRC - entity.CJZC - entity.FMZC - entity.FMRC - entity.CY - entity.MQty3;
                if (entity.Qty != 0m)
                {
                    entity.BMKF = entity.KF / entity.Qty;
                }

                if (entity.MQty4 != 0m)
                {
                    entity.FMQty = SysConvert.ToDecimal(entity.MQty4 * 1.0936132983377m);
                }
                else
                {
                    entity.FMQty = SysConvert.ToDecimal(entity.Qty * 1.0936132983377m);
                }
                if (!SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(6428)))//仓库出库选择客户直接带出该客户相关单据
                {
                    entity.Qty   = GetChangeQty(entity.Qty);
                    entity.FMQty = GetChangeQty(entity.FMQty);
                }
            }
        }
        /// <summary>
        /// 值改变
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            try
            {
                if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
                {
                    if (e.Column.FieldName == "ColorNum")                                //色号列值改变
                    {
                        if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5820))) //染整加工单加载时开启染厂色号读取色卡管理的染厂色号
                        {
                            string itemCode = SysConvert.ToString(gridView1.GetRowCellValue(e.RowHandle, "ItemCode"));
                            string colorNum = SysConvert.ToString(gridView1.GetRowCellValue(e.RowHandle, "ColorNum"));
                            string desingNo = Common.GetDesignNoByItemAndColorNum(itemCode, colorNum);
                            if (desingNo != string.Empty)
                            {
                                gridView1.SetRowCellValue(e.RowHandle, "DesignNo", desingNo);
                            }
                        }
                    }

                    if (e.Column.FieldName == "SL" || e.Column.FieldName == "Qty")//根据缩率和成品重量计算坯布重量
                    {
                        decimal Qty      = SysConvert.ToDecimal(gridView1.GetRowCellValue(e.RowHandle, "Qty"));
                        decimal SL       = SysConvert.ToDecimal(gridView1.GetRowCellValue(e.RowHandle, "SL"));
                        decimal PBWeight = Qty * (1 + SysConvert.ToDecimal(SL / 100, 2));
                        gridView1.SetRowCellValue(e.RowHandle, "PBWeight", PBWeight);
                    }
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName = "Data_Item";
            this.HTDataDts       = gridView6;
            this.HTDataDtsAttach = new DevExpress.XtraGrid.Views.Grid.GridView[] { gridView1, gridView2, gridView3, gridView6 };


            Common.BindVendor(drpGridFactoryID, new int [] { (int)EnumVendorType.工厂, (int)EnumVendorType.供应商 }, true);



            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5012)))//
            {
                btnCalc.Visible = true;
            }



            SetTabIndex(0, groupControlMainten);

            //txtItemCode.Properties.ReadOnly = true;

            Common.BindCLS(txtWeightUnit, "Data_Item", "WeightUnit", true);
            Common.BindCLS(txtOrgan, "Data_Item", "Organ", true);

            Common.BindCLS(drpItemUnit, "Data_Item", "ItemUnit", true);

            gridViewBaseRowChangedA3 += new gridViewBaseRowChangedA(gridViewRowChanged3);
            gridViewBindEventA3(gridView6);
        }
Beispiel #16
0
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            this.HTDataTableName = "Sale_SaleOrder";
            this.HTDataList      = gridView1;
            //this.HTDataDtsAttach = new GridView[] { gridView4 };
            this.HTQryContainer    = groupControlQuery;
            txtOrderDateS.DateTime = DateTime.Now.AddMonths(-2).Date;
            txtOrderDateE.DateTime = DateTime.Now.Date;
            txtMakeDateS.DateTime  = DateTime.Now.AddMonths(-2).Date;
            txtMakeDateE.DateTime  = DateTime.Now.Date;
            //this.ToolBarItemAdd(32, "btnUpdateOrderStep", "修改合同站别", true, UpdateOrderStepToolStripMenuItem_Click, eShortcut.None);
            this.ToolBarItemAdd(32, "btnUpdateOrderStatus", "修改合同状态", true, UpdateOrderStatusToolStripMenuItem_Click, eShortcut.None);
            //  this.ToolBarItemAdd(32, "btnCancelOrder", "撤单", true, btnCancelOrder_Click, eShortcut.None);
            //   this.ToolBarItemAdd(32, "btnCancelCancelOrder_Click", "取消撤单", true, btnCancelCancelOrder_Click, eShortcut.None);

            if (ProductParamSet.GetIntValueByID(5417) == (int)YesOrNo.Yes)//组织结构体系启用
            {
                chkOrderDate.Checked = false;
            }
            if (SaleOrderStepProc.ColorIniFlag)
            {
                ucStatusBarStand1.UCDataSource = SaleOrderStepProc.ColorStatusDt;
                ucStatusBarStand1.UCAct();
            }
            if (SaleOrderStatusProc.ColorIniFlag)
            {
                ucStatusBarStand2.UCDataSource = SaleOrderStatusProc.ColorStatusDt;
                ucStatusBarStand2.UCAct();
            }
        }
Beispiel #17
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void GetCondtion()
        {
            string tempStr = string.Empty;

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

            if (chkMakeDate.Checked)
            {
                tempStr += " AND MakeDate BETWEEN " + SysString.ToDBString(txtMakeDateS.DateTime) + " AND " + SysString.ToDBString(txtMakeDateE.DateTime);
            }
            if (SysConvert.ToString(drpSaleOPID.EditValue) != string.Empty)
            {
                tempStr += " AND SaleOPID=" + SysString.ToDBString(SysConvert.ToString(drpSaleOPID.EditValue));
            }
            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5430)) && !FParamConfig.LoginHTFlag)//销售订单业务员只查看自己的的订单
            {
                tempStr += " AND SaleOPID IN(" + WCommon.GetStructureMemberOPStr() + ")";
            }

            // tempStr += " AND SampleType=" + FormListBID;//打样类型
            tempStr += " AND SOType=" + FormListAID;//订单类型

            tempStr += " ORDER BY FormNo DESC";

            HTDataConditionStr = tempStr;
        }
Beispiel #18
0
        /// <summary>
        /// 数据初始化(填写表名、绑定控制、初始化界面属性等)
        /// </summary>
        public override void IniData()
        {
            ProcessGrid.BindGridColumn(gridView1, this.FormID);               //绑定列
            ProcessGrid.SetGridColumnUI(gridView1, FormListAID, FormListBID); //设置列UI
            //Common.BindOP(drpSaleOPID, true);
            this.HTDataTableName = "Sale_FHForm";
            this.HTDataList      = gridView1;

            this.HTQryContainer = groupControlQuery;

            if (ProductParamSet.GetIntValueByID(5020) == (int)YesOrNo.Yes)//组织结构体系启用
            {
                Common.BindOPID(drpSaleOPID, "Sale_SaleOrder", "SaleOPID", true);
            }
            else
            {
                Common.BindOPID(drpSaleOPID, true);
            }

            // Common.BindVendor(drpQVendorID, new int[] { (int)EnumVendorType.客户 }, true);
            DevMethod.BindVendor(drpQVendorID, new int[] { (int)EnumVendorType.客户 }, true);//2015.4.8 CX修改
            Common.BindFHType(drpFHTypeID, true);
            txtQMakeDateS.DateTime = DateTime.Now.AddDays(-10).Date;
            txtQMakeDateE.DateTime = DateTime.Now;
            if (FHFormStatusProc.ColorIniFlag)
            {
                //FHFormStatusProc.ColorIniTextBox(new TextBox[] { txtColorStatus1, txtColorStatus2});
                ucStatusBarStand1.UCValueIni(FHFormStatusProc.ColorStatusName, FHFormStatusProc.ColorStatusColor);
                ucStatusBarStand1.UCAct();
            }
        }
Beispiel #19
0
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmWait_Load(object sender, EventArgs e)
        {
            try
            {
                ProcessGrid.BindGridColumn(gridView1, this.FormID);                         //绑定列
                ProcessGrid.SetGridColumnUI(gridView1, this.FormListAID, this.FormListBID); //设置列UI



                SaleOrder entity = new SaleOrder();
                entity.ID = m_ID;
                entity.SelectByID();

                SaleItemType = Common.GetSaleItemTypeByID(entity.SaleFlowModuleID);



                if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5009)))//面料的坯布启用可替换坯布功能,影响到订单坯布算料、坯布采购、织造等
                {
                }
                else
                {
                    gridView1.Columns["CPItemCode"].Visible = false;
                }
                BindGrid();
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Beispiel #20
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }

                if (HTDataID == 0)
                {
                    this.ShowMessage("请选择要操作的记录");
                    return;
                }

                //if (!CheckCorrect())
                //{
                //    return;
                //}

                //sc 出库提交前校验细码与库存细码是否对上
                if (!SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(6402)))//非 成品仓库不使用码单模式
                {
                    for (int i = 0; i < ucFabView1.UCDataSource.Rows.Count; i++)
                    {
                        string    sql = "SELECT Qty FROM WH_PackBox WHERE BoxNo = " + SysString.ToDBString(SysConvert.ToString((ucFabView1.UCDataSource.Rows[i]["BoxNo"])));
                        DataTable dt  = SysUtils.Fill(sql);
                        if (dt.Rows.Count != 0)
                        {
                            if (SysConvert.ToDecimal(ucFabView1.UCDataSource.Rows[i]["Qty"]) != SysConvert.ToDecimal(dt.Rows[0]["Qty"]))
                            {
                                this.ShowMessage("此细码:" + SysConvert.ToString(ucFabView1.UCDataSource.Rows[i]["BoxNo"]) + "  已开过匹,与库存细码对应不上,请检查!");
                                return;
                            }
                        }
                    }
                }
                DBFormRule rule = new DBFormRule();
                if (!SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(6402)))//非 成品仓库不使用码单模式
                {
                    string o_ErrorMsg = string.Empty;
                    if (!rule.RCheckCorrectPackData(HTDataID, out o_ErrorMsg))// 如果校验不通过
                    {
                        this.ShowMessage(o_ErrorMsg);
                        return;
                    }
                }

                rule.RSubmit(HTDataID, (int)ConfirmFlag.已提交);

                FCommon.AddDBLog(this.Text, FormStatus.提交.ToString(), "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Beispiel #21
0
        /// <summary>
        /// 新增单据初始化控件数据(哪些值需要设置的设定一下)
        /// </summary>
        public override void IniInsertSet()
        {
            txtItemDate.DateTime = DateTime.Now.Date;
            txtMakeOPID.Text     = Common.GetOPName(FParamConfig.LoginID);

            txtItemCode_DoubleClick(null, null);
            drpItemUnit.Text = ProductParamSet.GetStrValueByID(5004);//辅料默认单位设置
        }
        private void SetSaleOrderFabric(string str)
        {
            if (str != "")
            {
                int    index = gridView1.FocusedRowHandle;//checkRowSet();
                string sql   = "SELECT ItemCode,ItemName,ItemModel,ItemStd,GoodsCode,FreeStr1,FormNo,Unit,CPItemCode,CPItemName,CPItemModel,CPItemStd,Sum(Qty) Qty";
                sql += " FROM UV1_Sale_SaleOrderTFabric WHERE DtsID in (" + str + ")";
                sql += " Group BY ItemCode,ItemName,ItemModel,ItemStd,GoodsCode,FreeStr1,FormNo,Unit,CPItemCode,CPItemName,CPItemModel,CPItemStd";
                DataTable dt = SysUtils.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        gridView1.SetRowCellValue(index + i, "ItemCode", SysConvert.ToString(dt.Rows[i]["ItemCode"]));
                        gridView1.SetRowCellValue(index + i, "ItemName", SysConvert.ToString(dt.Rows[i]["ItemName"]));
                        gridView1.SetRowCellValue(index + i, "ItemModel", SysConvert.ToString(dt.Rows[i]["ItemModel"]));
                        gridView1.SetRowCellValue(index + i, "ItemStd", SysConvert.ToString(dt.Rows[i]["ItemStd"]));

                        gridView1.SetRowCellValue(index + i, "GoodsCode", SysConvert.ToString(dt.Rows[i]["GoodsCode"])); //货号
                        gridView1.SetRowCellValue(index + i, "FreeStr1", SysConvert.ToString(dt.Rows[i]["FreeStr1"]));   //画本号

                        //gridView1.SetRowCellValue(i, "ColorName", SysConvert.ToString(dt.Rows[0]["ColorName"]));
                        gridView1.SetRowCellValue(index + i, "Qty", SysConvert.ToString(dt.Rows[i]["Qty"]));
                        gridView1.SetRowCellValue(index + i, "DtsSO", SysConvert.ToString(dt.Rows[i]["FormNo"]));
                        gridView1.SetRowCellValue(index + i, "Unit", SysConvert.ToString(dt.Rows[i]["Unit"]));



                        string[] itemInfo = Common.GetItemArrayByCode(SysConvert.ToString(dt.Rows[i]["ItemCode"]));
                        if (itemInfo.Length >= 6)
                        {
                            if (itemInfo[4] != string.Empty)
                            {
                                gridView1.SetRowCellValue(index + i, "MWidth", SysConvert.ToDecimal(itemInfo[4]));
                            }

                            if (itemInfo[5] != string.Empty)
                            {
                                gridView1.SetRowCellValue(index + i, "MWeight", SysConvert.ToDecimal(itemInfo[5]));
                            }
                        }

                        gridView1.SetRowCellValue(index + i, "CPItemCode", SysConvert.ToString(dt.Rows[i]["CPItemCode"]));
                        gridView1.SetRowCellValue(index + i, "CPItemName", SysConvert.ToString(dt.Rows[i]["CPItemName"]));
                        gridView1.SetRowCellValue(index + i, "CPItemModel", SysConvert.ToString(dt.Rows[i]["CPItemModel"]));
                        gridView1.SetRowCellValue(index + i, "CPItemStd", SysConvert.ToString(dt.Rows[i]["CPItemStd"]));

                        if (i == index)
                        {
                            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5009)))//面料的坯布启用可替换坯布功能,影响到订单坯布算料、坯布采购、织造等
                            {
                                Common.BindFabricItemByCPItemCode(drpGridItemCode, SysConvert.ToString(dt.Rows[i]["CPItemCode"]), true);
                            }
                        }
                    }
                }
            }
        }
Beispiel #23
0
        /// <summary>
        /// 查询条件
        /// </summary>
        public override void GetCondtion()
        {
            string tempStr = string.Empty;

            if (txtVendorName.Text.Trim() != "")//查询。
            {
                tempStr = " AND VendorName LIKE " + SysString.ToDBString("%" + txtVendorName.Text.Trim() + "%");
            }
            if (txtVendorID.Text.Trim() != "")
            {
                tempStr = " AND VendorID LIKE " + SysString.ToDBString("%" + txtVendorID.Text.Trim() + "%");
            }
            if (txtTelPhone.Text.Trim() != "")
            {
                tempStr = " AND Tel LIKE " + SysString.ToDBString("%" + txtTelPhone.Text.Trim() + "%");
            }
            if (txtTelPerson.Text.Trim() != "")
            {
                tempStr = " AND Contact LIKE " + SysString.ToDBString("%" + txtTelPerson.Text.Trim() + "%");
            }
            if (txtArea.Text.Trim() != "")
            {
                tempStr = " AND Area LIKE " + SysString.ToDBString("%" + txtArea.Text.Trim() + "%");
            }

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

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

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

            tempStr += " AND ( VendorTypeID IN(0," + SysString.ToDBString(FormListAID) + ") OR";
            tempStr += " VendorID IN(SELECT VendorID FROM Data_VendorTypeDts WHERE VendorTypeID IN(0," + SysString.ToDBString(FormListAID) + "))";
            tempStr += ")";
            //if (FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.审核2)&&!FParamConfig.LoginHTFlag)
            //{
            //    tempStr+="AND InSaleOP="+SysString.ToDBString(FParamConfig.LoginID);
            //}

            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5430)) && !FParamConfig.LoginHTFlag)//销售订单业务员只查看自己的的订单
            {
                tempStr += " AND InSaleOP IN(" + WCommon.GetStructureMemberOPStr() + ")";
            }


            tempStr           += " ORDER BY ID";
            HTDataConditionStr = tempStr;
        }
Beispiel #24
0
        /// <summary>
        /// 控件状态方法设置
        /// </summary>
        public override void SetInputStatus(bool p_Flag)
        {
            ProcessCtl.ProcControlEdit(gridControl3, p_Flag);
            drpVendorLevel.Text = SysConvert.ToString(ProductParamSet.GetStrValueByID(5025));

            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5021)))//客户编号自动生成
            {
                ProductCommon.FormNoCtlEditSet(txtVendorID, "Data_Vendor", "VendorID", this.FormListAID, p_Flag);
            }
        }
        private void BindGrid()
        {
            SaleOrderDts entitydts = new SaleOrderDts();

            entitydts.ID = m_DID;
            entitydts.SelectByID();
            string sql = "SELECT * FROM Sale_SaleOrderFabricCompSite WHERE MainID=" + SysString.ToDBString(m_ID);

            sql += " AND DID=" + SysString.ToDBString(m_DID);
            DataTable dt = SysUtils.Fill(sql);

            if (dt.Rows.Count > 0)
            {
                gridView1.GridControl.DataSource = SysUtils.Fill(sql);
                gridView1.GridControl.Show();

                decimal TotalQty = 0;
                for (int i = 0; i < gridView1.RowCount; i++)
                {
                    TotalQty += SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "Qty"));
                }
                txtTotalQty.Text = TotalQty.ToString();
            }
            else
            {
                sql = "SELECT ItemCode,ItemName,ItemStd,ItemModel,ComTypeID FROM UV1_Data_ItemCompositeDts WHERE MainID IN (SELECT ID FROM Data_Item WHERE ItemCode=" + SysString.ToDBString(entitydts.ItemCode) + ")";
                DataTable dto = SysUtils.Fill(sql);
                for (int i = 0; i < dto.Rows.Count; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr["ItemCode"]  = SysConvert.ToString(dto.Rows[i]["ItemCode"]);
                    dr["ItemName"]  = SysConvert.ToString(dto.Rows[i]["ItemName"]);
                    dr["ItemStd"]   = SysConvert.ToString(dto.Rows[i]["ItemStd"]);
                    dr["ComTypeID"] = SysConvert.ToInt32(dto.Rows[i]["ComTypeID"]);
                    dr["ColorName"] = entitydts.ColorName;
                    dr["ItemModel"] = SysConvert.ToString(dto.Rows[i]["ItemModel"]);
                    dr["SQty"]      = entitydts.Qty;
                    dr["RQty"]      = entitydts.Qty;
                    dr["Unit"]      = "KG";
                    if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5405)))                     //转换为默认单位模式开启,目前支持转换为公斤模式
                    {
                        string unitdefault = SysConvert.ToString(ProductParamSet.GetStrValueByID(5406)); //转换后默认单位
                        if (unitdefault != string.Empty)
                        {
                            dr["Unit"] = unitdefault;
                            //entitydts[index].Unit = unitdefault;//赋值转换后单位
                        }
                    }
                    dr["SO"] = m_SO;
                    dt.Rows.Add(dr);
                }
                gridView1.GridControl.DataSource = dt;
                gridView1.GridControl.Show();
            }
        }
Beispiel #26
0
        /// <summary>
        /// 新增初始化
        /// </summary>
        public override void IniInsertSet()
        {
            txtWeightUnit.Text = "g/m";
            txtItemCode_DoubleClick(null, null);

            drpUseable.EditValue = 1;
            drpPFlag.EditValue   = 0;
            drpXFlag.EditValue   = 0;
            txtItemDate.DateTime = DateTime.Now.Date;

            drpItemUnit.Text = ProductParamSet.GetStrValueByID(5002);//坯布默认单位设置
        }
Beispiel #27
0
        /// <summary>
        /// 控件状态方法设置
        /// </summary>
        public override void SetInputStatus(bool p_Flag)
        {
            ProcessCtl.ProcControlEdit(gridControl3, p_Flag);

            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5021)))//客户编号自动生成
            {
                ProductCommon.FormNoCtlEditSet(txtVendorID, "Data_Vendor", "VendorID", this.FormListAID, p_Flag);
            }

            ProcessGrid.SetGridEdit(gridView6, new string[] { "Name" }, false);
            ProcessGrid.SetGridColumnReadOnly(gridView6, new string[] { "Name" }, true);
        }
Beispiel #28
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void BindGrid()
        {
            IOFormRule rule = new IOFormRule();
            DataTable  dt   = rule.RShowDts(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1).Replace("DtsVendorName", "'' DtsVendorName"));

            if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(6425)))//查询带出订单客户
            {
                SetGirdDataSource(dt);
            }
            gridView1.GridControl.DataSource = dt;
            gridView1.GridControl.Show();
        }
Beispiel #29
0
 /// <summary>
 /// 控制自动生成客户编号
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txtVendorID_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (HTFormStatus == FormStatus.新增 && SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5021)))
         {
             ProductCommon.FormNoIniSet(txtVendorID, "Data_Vendor", "VendorID", this.FormListAID);
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Beispiel #30
0
        private void SetSaleOrderFabric(string str)
        {
            string[] arr = str.Split(',');
            //int index = gridView1.FocusedRowHandle;//checkRowSet();
            int index  = 0;//只保存一条数据
            int length = 0;

            for (int i = index; i < arr.Length + index; i++)
            {
                string    sql = "SELECT * FROM UV1_Sale_SaleOrderTFabric WHERE DtsID=" + SysString.ToDBString(SysConvert.ToInt32(arr[length]));
                DataTable dt  = SysUtils.Fill(sql);

                if (dt.Rows.Count > 0)
                {
                    gridView1.SetRowCellValue(i, "ItemCode", SysConvert.ToString(dt.Rows[0]["ItemCode"]));
                    gridView1.SetRowCellValue(i, "ItemName", SysConvert.ToString(dt.Rows[0]["ItemName"]));
                    gridView1.SetRowCellValue(i, "ItemModel", SysConvert.ToString(dt.Rows[0]["ItemModel"]));
                    gridView1.SetRowCellValue(i, "ItemStd", SysConvert.ToString(dt.Rows[0]["ItemStd"]));
                    gridView1.SetRowCellValue(i, "ColorName", SysConvert.ToString(dt.Rows[0]["ColorName"]));
                    gridView1.SetRowCellValue(i, "Qty", SysConvert.ToDecimal(dt.Rows[0]["Qty"]));
                    gridView1.SetRowCellValue(i, "DtsSO", SysConvert.ToString(dt.Rows[0]["FormNo"]));
                    gridView1.SetRowCellValue(i, "Unit", SysConvert.ToString(dt.Rows[0]["Unit"]));

                    gridView1.SetRowCellValue(i, "CPItemCode", SysConvert.ToString(dt.Rows[0]["CPItemCode"]));
                    gridView1.SetRowCellValue(i, "CPItemName", SysConvert.ToString(dt.Rows[0]["CPItemName"]));
                    gridView1.SetRowCellValue(i, "CPItemModel", SysConvert.ToString(dt.Rows[0]["CPItemModel"]));
                    gridView1.SetRowCellValue(i, "CPItemStd", SysConvert.ToString(dt.Rows[0]["CPItemStd"]));

                    if (i == index)                   //第一行
                    {
                        if (groupControlItem.Visible) //物料用料控件容器可见 绑定物料使用
                        {
                            SetFabUseItemDts(SysConvert.ToString(dt.Rows[0]["ItemCode"]));
                        }


                        if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5009)))//面料的坯布启用可替换坯布功能,影响到订单坯布算料、坯布采购、织造等
                        {
                            Common.BindFabricItemByCPItemCode(drpGridItemCode, SysConvert.ToString(dt.Rows[0]["CPItemCode"]), true);
                        }
                    }
                }
                length++;
            }
            if (groupControlItem.Visible) //物料用料控件容器可见 绑定物料使用
            {
                SetFabUseItemDtsCalc();   //计算用料
            }
        }