private ProductSearchData GetData() { ProductSearchData data = new ProductSearchData(); data.ACTIVE = (this.chkActive.Checked ? Constz.ActiveStatus.Active : Constz.ActiveStatus.InActive); data.CODE = this.txtCode.Text.Trim(); data.BARCODE = this.txtBarCode.Text.Trim(); data.COST = Convert.ToDouble(this.txtCost.Text == "" ? "0" : this.txtCost.Text); data.LEADTIME = Convert.ToDouble(this.txtLeadtime.Text == "" ? "0" : this.txtLeadtime.Text); data.LOTSIZE = Convert.ToDouble(this.txtLotSize.Text == "" ? "0" : this.txtLotSize.Text); data.LEADTIMEPD = Convert.ToDouble(this.txtLeadtimePD.Text == "" ? "0" : this.txtLeadtimePD.Text); data.LOTSIZEPD = Convert.ToDouble(this.txtLotSizePD.Text == "" ? "0" : this.txtLotSizePD.Text); data.ORDERTYPE = this.rbtOrderType.SelectedItem.Value.Trim(); data.PRICE = Convert.ToDouble(this.txtPrice.Text == "" ? "0" : this.txtPrice.Text); data.STDPRICE = Convert.ToDouble(this.txtStdPrice.Text == "" ? "0" : this.txtStdPrice.Text); data.PRODUCTGROUP = Convert.ToDouble(this.cmbProductGroup.SelectedItem.Value); data.LOID = Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text); data.NAME = this.txtName.Text.Trim(); data.ENAME = this.txtEName.Text.Trim(); data.ABBNAME = this.txtAbbName.Text.Trim(); data.PRODUCTTYPE = Convert.ToDouble(this.cmbProductType.SelectedItem.Value); data.UNIT = Convert.ToDouble(this.cmbUnit.SelectedItem.Value); data.PACKSIZEUNIT = Convert.ToDouble(this.cmbUnitPack.SelectedItem.Value); data.PACKSIZE = Convert.ToDouble(this.txtPacksize.Text == "" ? "0" : this.txtPacksize.Text); //data.AGE = Convert.ToDouble(this.txtAge.Text == "" ? "0" : this.txtAge.Text); data.PBLOID = Convert.ToDouble(this.txtPBLOID.Text == "" ? "0" : this.txtPBLOID.Text); return data; }
private void SetData(ProductSearchData data) { this.txtLOID.Text = data.LOID.ToString(); this.txtMasterUnit.Text = data.UNIT.ToString(); this.txtPackSizeUint.Text = data.PACKSIZEUNIT.ToString(); this.txtName.Text = data.NAME; this.grvItem.DataBind(); }
private void ValidateData(ProductSearchData data) { if (data.LOID == 0) { if (data.CODE.Trim() == "") throw new ApplicationException("¡ÃسÒÃкØÃËÑÊÇѵ¶Ø´Ôº"); else if (data.PRODUCTTYPE == 0) throw new ApplicationException("¡ÃسÒàÅ×Í¡»ÃÐàÀ·Çѵ¶Ø´Ôº"); else if (data.PRODUCTGROUP == 0) throw new ApplicationException("¡ÃسÒàÅ×Í¡¡ÅØèÁÇѵ¶Ø´Ôº"); else if (data.NAME.Trim() == "") throw new ApplicationException("¡ÃسÒÃкت×èÍÇѵ¶Ø´Ôº"); else if (data.ABBNAME.Trim() == "") throw new ApplicationException("¡ÃسÒÃкت×èÍÂèÍÇѵ¶Ø´Ôº"); else if (data.BARCODE.Trim() == "") throw new ApplicationException("¡ÃسÒÃкغÒÃìâ¤é´"); else if (data.UNIT == 0) throw new ApplicationException("¡ÃسÒàÅ×͡˹èÇÂÇѵ¶Ø´Ôº"); else if (data.COST == 0) throw new ApplicationException("¡ÃسÒÃкØÃҤҷع"); else if (data.ORDERTYPE.Trim() == "") throw new ApplicationException("¡ÃسÒàÅ×Í¡ÇÔ¸Õ¡ÒùÓà¢éÒ"); else if ((data.ORDERTYPE.Trim() == "PO" || data.ORDERTYPE.Trim() == "AR") && data.LEADTIME == 0) throw new ApplicationException("¡ÃسÒÃкØÃÐÂÐàÇÅÒ¡ÒÃÊÑ觫×éÍ"); else if ((data.ORDERTYPE.Trim() == "PD" || data.ORDERTYPE.Trim() == "AR") && data.LEADTIMEPD == 0) throw new ApplicationException("¡ÃسÒÃкØÃÐÂÐàÇÅÒ¡ÒüÅÔµ"); else if ((data.ORDERTYPE.Trim() == "PO" || data.ORDERTYPE.Trim() == "AR") && data.LOTSIZE == 0) throw new ApplicationException("¡ÃسÒÃкبӹǹ¡ÒÃÊÑ觫×éÍ"); else if ((data.ORDERTYPE.Trim() == "PD" || data.ORDERTYPE.Trim() == "AR") && data.LOTSIZEPD == 0) throw new ApplicationException("¡ÃسÒÃкبӹǹ¡ÒüÅÔµ"); else if (data.PACKSIZE == 0) throw new ApplicationException("¡ÃسÒÃкآ¹Ò´ºÃèØ"); else if (data.PACKSIZEUNIT == 0) throw new ApplicationException("¡ÃسÒàÅ×͡˹èÇ¢¹Ò´ºÃèØ"); else if (MasterDALObj.CheckCode(data.LOID, data.CODE.Trim()) == false) throw new ApplicationException("ÃËÑÊÇѵ¶Ø´Ôº¹ÕéÁÕáÅéÇ"); else if (MasterDALObj.CheckName(data.LOID, data.NAME.Trim()) == false) throw new ApplicationException("ª×èÍÇѵ¶Ø´Ôº¹ÕéÁÕáÅéÇ"); if (data.ENAME != "") { if (MasterDALObj.CheckEName(data.LOID, data.ENAME.Trim()) == false) throw new ApplicationException("ª×èÍÇѵ¶Ø´ÔºÀÒÉÒÍѧ¡ÄɹÕéÁÕáÅéÇ"); } if (BarcodeDALObj.CheckBarcode(data.LOID, data.BARCODE.Trim(), data.PBLOID) == false) throw new ApplicationException("ºÒÃìâ¤é´ " + data.BARCODE + " ¹ÕéÁÕáÅéÇ"); else if (BarcodeDALObj.CheckAbbname(data.LOID, data.ABBNAME.Trim(), data.PBLOID) == false) throw new ApplicationException("ª×èÍÂèÍ " + data.ABBNAME + " ¹ÕéÁÕáÅéÇ"); else if (BarcodeDALObj.CheckUnit(data.LOID, data.UNIT.ToString(), data.PBLOID) == false) throw new ApplicationException("˹èǹѺ¹ÕéÁÕáÅéÇ"); } }
private void ValidateData(ProductSearchData data) { if (data.LOID == 0) { if (data.PRODUCTTYPE == 0) throw new ApplicationException("¡ÃسÒàÅ×Í¡»ÃÐàÀ·ÊÔ¹¤éÒ"); else if (data.PRODUCTGROUP == 0) throw new ApplicationException("¡ÃسÒàÅ×Í¡¡ÅØèÁÊÔ¹¤éÒ"); else if (data.CODE.Trim() == "") throw new ApplicationException("¡ÃسÒÃкØÃËÑÊÊÔ¹¤éÒ"); else if (data.NAME.Trim() == "") throw new ApplicationException("¡ÃسÒÃкت×èÍÊÔ¹¤éÒ"); else if (data.ABBNAME.Trim() == "") throw new ApplicationException("¡ÃسÒÃкت×èÍÂèÍÊÔ¹¤éÒ"); else if (data.BARCODE.Trim() == "") throw new ApplicationException("¡ÃسÒÃкغÒÃìâ¤é´"); else if (data.UNIT == 0) throw new ApplicationException("¡ÃسÒàÅ×͡˹èÇÂÊÔ¹¤éÒ"); else if (data.COST == 0) throw new ApplicationException("¡ÃسÒÃкØÃҤҷع"); else if (data.PRICE == 0) throw new ApplicationException("¡ÃسÒÃкØÃÒ¤Ò¢ÒÂ"); else if (data.ORDERTYPE.Trim() == "") throw new ApplicationException("¡ÃسÒàÅ×Í¡ÇÔ¸Õ¡ÒùÓà¢éÒ"); else if ((data.ORDERTYPE.Trim() == "PO" || data.ORDERTYPE.Trim() == "AR") && data.LEADTIME == 0) throw new ApplicationException("¡ÃسÒÃкØÃÐÂÐàÇÅÒ¡ÒÃÊÑ觫×éÍ"); else if ((data.ORDERTYPE.Trim() == "PD" || data.ORDERTYPE.Trim() == "AR") && data.LEADTIMEPD == 0) throw new ApplicationException("¡ÃسÒÃкØÃÐÂÐàÇÅÒ¡ÒüÅÔµ"); else if ((data.ORDERTYPE.Trim() == "PO" || data.ORDERTYPE.Trim() == "AR") && data.LOTSIZE == 0) throw new ApplicationException("¡ÃسÒÃкبӹǹ¡ÒÃÊÑ觫×éÍ"); else if ((data.ORDERTYPE.Trim() == "PD" || data.ORDERTYPE.Trim() == "AR") && data.LOTSIZEPD == 0) throw new ApplicationException("¡ÃسÒÃкبӹǹ¡ÒüÅÔµ"); else if (data.PACKSIZE == 0) throw new ApplicationException("¡ÃسÒÃкآ¹Ò´ºÃèØ"); else if (data.PACKSIZEUNIT == 0) throw new ApplicationException("¡ÃسÒàÅ×͡˹èÇ¢¹Ò´ºÃèØ"); } }
public ProductSearchData GetData(double loid) { ProductSearchData data = new ProductSearchData(); if (MasterDALObj.GetDataByLOID(loid, null)) { string sqlstr = MasterDALObj.LOID.ToString() + " AND ISDEFAULT = 'Y'"; BarcodeDALObj.GetDataByProductMaster(sqlstr, null); data.LOID = MasterDALObj.LOID; data.PBLOID = BarcodeDALObj.LOID; data.CODE = MasterDALObj.CODE; data.ACTIVE = MasterDALObj.ACTIVE; data.BARCODE = BarcodeDALObj.BARCODE; data.NAME = MasterDALObj.NAME; data.ENAME = MasterDALObj.ENAME; data.ABBNAME = BarcodeDALObj.ABBNAME; data.PRODUCTGROUP = MasterDALObj.PRODUCTGROUP; ABB.DAL.ProductGroupDAL groupDAL = new ABB.DAL.ProductGroupDAL(); groupDAL.GetDataByLOID(MasterDALObj.PRODUCTGROUP, null); data.PRODUCTTYPE = groupDAL.PRODUCTTYPE; data.COST = BarcodeDALObj.COST; data.LEADTIME = MasterDALObj.LEADTIME; data.LOTSIZE = MasterDALObj.LOTSIZE; data.LEADTIMEPD = MasterDALObj.LEADTIMEPD; data.LOTSIZEPD = MasterDALObj.LOTSIZEPD; data.ORDERTYPE = MasterDALObj.ORDERTYPE; data.PRICE = BarcodeDALObj.PRICE; data.REGISNO = MasterDALObj.REGISNO; data.STDPRICE = BarcodeDALObj.STDPRICE; data.UNIT = MasterDALObj.UNIT; data.PACKSIZE = BarcodeDALObj.PACKSIZE; data.PACKSIZEUNIT = BarcodeDALObj.PACKSIZEUNIT; //data.AGE = MasterDALObj.AGE; } return data; }
private void SetData(ProductSearchData data) { this.txtLOID.Text = data.LOID.ToString(); this.txtCode.Text = data.CODE.Trim(); this.cmbProductType.SelectedIndex = this.cmbProductType.Items.IndexOf(this.cmbProductType.Items.FindByValue(data.PRODUCTTYPE.ToString())); this.chkActive.Checked = (data.ACTIVE == Constz.ActiveStatus.Active); this.txtName.Text = data.NAME.Trim(); this.txtEName.Text = data.ENAME.Trim(); this.txtAbbName.Text = data.ABBNAME.Trim(); this.txtBarCode.Text = data.BARCODE.Trim(); this.txtCost.Text = data.COST.ToString(); this.txtLeadtime.Text = data.LEADTIME.ToString(); this.txtLotSize.Text = data.LOTSIZE.ToString(); this.txtLeadtimePD.Text = data.LEADTIMEPD.ToString(); this.txtLotSizePD.Text = data.LOTSIZEPD.ToString(); this.rbtOrderType.SelectedValue = data.ORDERTYPE; this.txtPrice.Text = data.PRICE.ToString(); this.txtStdPrice.Text = data.STDPRICE.ToString(); getDataToGroup(); this.cmbProductGroup.SelectedIndex = this.cmbProductGroup.Items.IndexOf(this.cmbProductGroup.Items.FindByValue(data.PRODUCTGROUP.ToString())); this.cmbUnit.SelectedIndex = this.cmbUnit.Items.IndexOf(this.cmbUnit.Items.FindByValue(data.UNIT.ToString())); this.cmbUnitPack.SelectedIndex = this.cmbUnitPack.Items.IndexOf(this.cmbUnitPack.Items.FindByValue(data.PACKSIZEUNIT.ToString())); this.txtPacksize.Text = data.PACKSIZE.ToString(); //this.txtAge.Text = data.AGE.ToString(); this.txtPBLOID.Text = data.PBLOID.ToString(); }
private void SetData(ProductSearchData data) { this.txtLOID.Text = data.LOID.ToString(); this.cmbProductType.SelectedIndex = this.cmbProductType.Items.IndexOf(this.cmbProductType.Items.FindByValue(data.PRODUCTTYPE.ToString())); this.chkActive.Checked = (data.ACTIVE == Constz.ActiveStatus.Active); this.txtName.Text = data.NAME.Trim(); this.txtEName.Text = data.ENAME.Trim(); this.txtAbbName.Text = data.ABBNAME.Trim(); this.txtBarCode.Text = data.BARCODE.Trim(); this.txtCost.Text = data.COST.ToString(Constz.DblFormat); this.rbtIsDiscount.SelectedValue = data.ISDISCOUNT; this.rbtIsEdit.SelectedValue = data.ISEDIT; this.rbtIsVat.SelectedValue = data.ISVAT; this.txtLeadtime.Text = data.LEADTIME.ToString(Constz.IntFormat); this.txtLotSize.Text = data.LOTSIZE.ToString(Constz.IntFormat); this.txtLeadtimePD.Text = data.LEADTIMEPD.ToString(Constz.IntFormat); this.txtLotSizePD.Text = data.LOTSIZEPD.ToString(Constz.IntFormat); this.rbtOrderType.SelectedValue = data.ORDERTYPE; this.txtPrice.Text = data.PRICE.ToString(Constz.DblFormat); getDataToGroup(); this.cmbProductGroup.SelectedIndex = this.cmbProductGroup.Items.IndexOf(this.cmbProductGroup.Items.FindByValue(data.PRODUCTGROUP.ToString())); this.txtRegisNo.Text = data.REGISNO.ToString(); this.cmbUnit.SelectedIndex = this.cmbUnit.Items.IndexOf(this.cmbUnit.Items.FindByValue(data.UNIT.ToString())); this.cmbUnitPack.SelectedIndex = this.cmbUnitPack.Items.IndexOf(this.cmbUnitPack.Items.FindByValue(data.PACKSIZEUNIT.ToString())); this.rbtIsRefund.SelectedIndex = this.rbtIsRefund.Items.IndexOf(this.rbtIsRefund.Items.FindByValue(data.ISREFUND)); this.txtPacksize.Text = data.PACKSIZE.ToString(Constz.IntFormat); this.txtAge.Text = data.AGE.ToString(Constz.IntFormat); this.txtPBLOID.Text = data.PBLOID.ToString(); this.txtCode.Text = data.CODE.Trim(); this.cmbProduceGroup.SelectedIndex = this.cmbProduceGroup.Items.IndexOf(this.cmbProduceGroup.Items.FindByValue(data.PRODUCEGROUP.ToString())); CheckOrderType(); }
private void SetProductDetail(ProductSearchData data, GridViewRow gRow, TextBox txtBarcode, DropDownList cmbProduct, TextBox txtUnit, TextBox txtPrice, TextBox txtNetPrice, TextBox txtPDQty, TextBox txtQty) { txtBarcode.Text = data.BARCODE; txtPDQty.Text = Convert.ToString(data.PDQTY); cmbProduct.SelectedIndex = cmbProduct.Items.IndexOf(cmbProduct.Items.FindByValue(data.LOID.ToString())); txtUnit.Text = Convert.ToString(data.UNITNAME); txtPrice.Text = data.PRICE.ToString(Constz.DblFormat); txtNetPrice.Text = (Convert.ToDouble(txtQty.Text == "" ? "0" : txtQty.Text) * data.PRICE).ToString(Constz.DblFormat); gRow.Cells[16].Text = data.UNIT.ToString() ; }
public bool UpdateItemData(string userID, ProductSearchData data) { bool ret = true; OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { ProductBarcodeDAL itemDAL = new ProductBarcodeDAL(); ProductBarcodeDAL itemDAL2 = new ProductBarcodeDAL(); ProductBarcodeDAL itemDAL3 = new ProductBarcodeDAL(); //itemDAL.DeleteDataByProductMasterExceptDefault(data.LOID, obj.zTrans); itemDAL.UpdateActiveByProductMasterExceptDefault(data.LOID, "0", userID, obj.zTrans); for (Int16 i = 1; i < data.ITEM.Count; ++i) { ProductBarcodeData item = (ProductBarcodeData)data.ITEM[i]; itemDAL.OnDB = false; itemDAL.ACTIVE = ""; itemDAL.GetDataByBARCODE(item.BARCODE, obj.zTrans); if (itemDAL.ACTIVE != Constz.ActiveStatus.Active) { itemDAL2.GetDataByABBNAME(item.ABBNAME.Trim(), obj.zTrans); if (itemDAL2.ACTIVE == Constz.ActiveStatus.Active) { throw new ApplicationException("ª×èÍÂèÍ " + item.ABBNAME + " ¹ÕéÁÕáÅéÇ"); } itemDAL3.GetDataByABBUNIT(item.LOID,item.UNIT, obj.zTrans); if (itemDAL3.ACTIVE == Constz.ActiveStatus.Active) { throw new ApplicationException("ª×èÍ˹èÇ«éÓ"); } itemDAL.BARCODE = item.BARCODE; itemDAL.PRODUCTMASTER = data.LOID; itemDAL.ABBNAME = item.ABBNAME; itemDAL.UNIT = item.UNIT; itemDAL.COST = item.COST; itemDAL.PRICE = item.PRICE; itemDAL.STDPRICE = item.STDPRICE; itemDAL.ISDISCOUNT = "0"; itemDAL.ISVAT = "1"; itemDAL.PACKSIZE = item.PACKSIZE; itemDAL.PACKSIZEUNIT = item.UNITPACK; itemDAL.ISEDIT = "Y"; itemDAL.ISREFUND = "N"; itemDAL.ACTIVE = Convert.ToString(item.ACTIVE); itemDAL.MULTIPLY = item.MULTIPLY; itemDAL.ISDEFAULT = "N"; if (itemDAL.OnDB) ret = itemDAL.UpdateCurrentData(userID, obj.zTrans); else ret = itemDAL.InsertCurrentData(userID, obj.zTrans); if (!ret) throw new ApplicationException(itemDAL.ErrorMessage); } else { throw new ApplicationException("ºÒÃìâ¤é´ " + item.BARCODE + " ¹ÕéÁÕáÅéÇ"); } } _LOID = data.LOID; obj.zTrans.Commit(); obj.CloseConnection(); } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; _error = ex.Message; } return ret; }
public bool UpdateData(string userID, ProductSearchData data) { bool ret = true; ValidateData(data); OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { MasterDALObj.OnDB = false; MasterDALObj.GetDataByLOID(data.LOID, obj.zTrans); BarcodeDALObj.GetDataByProductMaster(data.LOID.ToString(), obj.zTrans); MasterDALObj.NAME = data.NAME.Trim(); MasterDALObj.ENAME = data.ENAME.Trim(); MasterDALObj.CODE = data.CODE.Trim(); BarcodeDALObj.ABBNAME = data.ABBNAME.Trim(); MasterDALObj.PRODUCTGROUP = data.PRODUCTGROUP; MasterDALObj.ACTIVE = data.ACTIVE.Trim(); BarcodeDALObj.ACTIVE = data.ACTIVE.Trim(); BarcodeDALObj.BARCODE = data.BARCODE.Trim(); BarcodeDALObj.COST = data.COST; BarcodeDALObj.ISDISCOUNT = "0"; BarcodeDALObj.ISEDIT = "Y"; BarcodeDALObj.ISVAT = "0"; MasterDALObj.LEADTIME = data.LEADTIME; MasterDALObj.LOTSIZE = data.LOTSIZE; MasterDALObj.LEADTIMEPD = data.LEADTIMEPD; MasterDALObj.LOTSIZEPD = data.LOTSIZEPD; MasterDALObj.ORDERTYPE = data.ORDERTYPE.Trim(); BarcodeDALObj.PRICE = data.PRICE; MasterDALObj.REGISNO = ""; BarcodeDALObj.STDPRICE = data.STDPRICE; MasterDALObj.UNIT = data.UNIT; BarcodeDALObj.UNIT = data.UNIT; BarcodeDALObj.PACKSIZE = data.PACKSIZE; BarcodeDALObj.PACKSIZEUNIT = data.PACKSIZEUNIT; BarcodeDALObj.ISREFUND = "N"; MasterDALObj.AGE = 0; BarcodeDALObj.ISDEFAULT = "Y"; BarcodeDALObj.MULTIPLY = 1; BarcodeDALObj.ACTIVE = "1"; if (MasterDALObj.OnDB) { ret = MasterDALObj.UpdateCurrentData(userID, obj.zTrans); if (!ret) { throw new ApplicationException(MasterDALObj.ErrorMessage); } BarcodeDALObj.PRODUCTMASTER = MasterDALObj.LOID; ret = BarcodeDALObj.UpdateCurrentData(userID, obj.zTrans); if (!ret) { throw new ApplicationException(BarcodeDALObj.ErrorMessage); } } else { ret = MasterDALObj.InsertCurrentData(userID, obj.zTrans); if (!ret) { throw new ApplicationException(MasterDALObj.ErrorMessage); } BarcodeDALObj.PRODUCTMASTER = MasterDALObj.LOID; ret = BarcodeDALObj.InsertCurrentData(userID, obj.zTrans); if (!ret) { throw new ApplicationException(BarcodeDALObj.ErrorMessage); } } _LOID = MasterDALObj.LOID; obj.zTrans.Commit(); obj.CloseConnection(); } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; throw new ApplicationException(ex.Message); } return ret; }
private void ValidateData2(ProductSearchData data) { if (MasterDALObj.CheckName(data.LOID, data.NAME.Trim()) == false) throw new ApplicationException("ª×èÍÊÔ¹¤éÒÀÒÉÒä·Â¹ÕéÁÕáÅéÇ"); if (MasterDALObj.CheckCode(data.LOID, data.CODE.Trim()) == false) throw new ApplicationException("ÃËÑÊÊÔ¹¤éÒ¹ÕéÁÕáÅéÇ"); if (data.ENAME != "") { if (MasterDALObj.CheckEName(data.LOID, data.ENAME.Trim()) == false) throw new ApplicationException("ª×èÍÊÔ¹¤éÒÀÒÉÒÍѧ¡ÄɹÕéÁÕáÅéÇ"); } if (BarcodeDALObj.CheckBarcode(data.LOID, data.BARCODE.Trim(), data.PBLOID) == false) throw new ApplicationException("ºÒÃìâ¤é´¹ÕéÁÕáÅéÇ"); if (BarcodeDALObj.CheckAbbname(data.LOID, data.ABBNAME.Trim(), data.PBLOID) == false) throw new ApplicationException("ª×èÍÂè͹ÕéÁÕáÅéÇ"); if (BarcodeDALObj.CheckUnit(data.LOID, data.UNIT.ToString(), data.PBLOID) == false) throw new ApplicationException("˹èǹѺ¹ÕéÁÕáÅéÇ"); }
private void SetProductDetail(ProductSearchData data, GridViewRow gRow, TextBox txtBarcode, DropDownList cmbProduct, DropDownList cmbUnit, Controls_DatePickerControl txtDate) { txtBarcode.Text = data.BARCODE; cmbProduct.SelectedIndex = cmbProduct.Items.IndexOf(cmbProduct.Items.FindByValue(data.LOID.ToString())); cmbUnit.SelectedIndex = cmbUnit.Items.IndexOf(cmbUnit.Items.FindByValue(data.UNIT.ToString())); txtDate.DateValue = DateTime.Now.Date.AddDays(data.LEADTIMEPD); //if (txtBarcode.ID == "txtNewBarCode" && txtBarcode.Text != "") // InsertData(gRow); }
private void SetProductDetail(ProductSearchData data, GridViewRow gRow, TextBox txtBarcode, DropDownList cmbProduct, TextBox txtUnit, TextBox txtOldPrice, TextBox txtNewPrice) { txtBarcode.Text = data.BARCODE; txtUnit.Text = FlowObj.GetUnitName(data.UNIT); txtOldPrice.Text = data.PRICE.ToString(Constz.DblFormat); txtNewPrice.Text = CalNewPrice(data.PRICE).ToString(Constz.DblFormat); cmbProduct.SelectedIndex = cmbProduct.Items.IndexOf(cmbProduct.Items.FindByValue(data.LOID.ToString())); if (txtBarcode.ID == "txtNewBarCode" && txtBarcode.Text != "") InsertData(gRow); }
public ProductSearchData GetDataVProduct(string barCode) { ProductSearchData data = new ProductSearchData(); if (VPDDALObj.GetDataByBarCode(barCode, null)) { data.LOID = VPDDALObj.LOID; data.ACTIVE = VPDDALObj.ACTIVE; data.BARCODE = VPDDALObj.BARCODE; data.CODE = VPDDALObj.CODE; data.NAME = VPDDALObj.NAME; data.COST = VPDDALObj.COST; data.PDQTY = VPDDALObj.QTY; data.PRICE = VPDDALObj.PRICE; data.UNIT = VPDDALObj.UNIT; data.UNITNAME = VPDDALObj.UNAME; } return data; }
public ProductSearchData GetData(string barCode) { ProductSearchData data = new ProductSearchData(); if (DALObj.GetDataByBarCode(barCode, null)) { data.LOID = DALObj.LOID; data.ACTIVE = DALObj.ACTIVE; data.BARCODE = DALObj.BARCODE; data.CODE = DALObj.CODE; data.NAME = DALObj.NAME; data.ABBNAME = DALObj.ABBNAME; data.PRODUCTGROUP = DALObj.PRODUCTGROUP; ABB.DAL.ProductGroupDAL groupDAL = new ABB.DAL.ProductGroupDAL(); groupDAL.GetDataByLOID(DALObj.PRODUCTGROUP, null); data.PRODUCTTYPE = groupDAL.PRODUCTTYPE; data.COST = DALObj.COST; data.ISDISCOUNT = DALObj.ISDISCOUNT; data.ISEDIT = DALObj.ISEDIT; data.ISVAT = DALObj.ISVAT; data.LEADTIME = DALObj.LEADTIME; data.LOTSIZE = DALObj.LOTSIZE; data.ORDERTYPE = DALObj.ORDERTYPE; data.PRICE = DALObj.PRICE; data.REGISNO = DALObj.REGISNO; data.STDPRICE = DALObj.STDPRICE; data.UNIT = DALObj.UNIT; } return data; }
public ProductSearchData GetDataVProduct(double loid) { ProductSearchData data = new ProductSearchData(); if (VPDDALObj.GetDataByLOID(loid, null)) { data.LOID = VPDDALObj.LOID; data.ACTIVE = VPDDALObj.ACTIVE; data.BARCODE = VPDDALObj.BARCODE; data.CODE = VPDDALObj.CODE; data.NAME = VPDDALObj.NAME; data.COST = VPDDALObj.COST; data.PDQTY = VPDDALObj.QTY; data.PRICE = VPDDALObj.PRICE; data.UNIT = VPDDALObj.UNIT; data.UNITNAME = VPDDALObj.UNAME; } return data; }
public ProductSearchData GetProductBarcode(double loid) { ProductSearchData data = new ProductSearchData(); if (BarcodeDALObj.GetDataByLOID(loid, null)) { data.LOID = BarcodeDALObj.LOID; //data.CODE = BarcodeDALObj.CODE; //data.ACTIVE = BarcodeDALObj.ACTIVE; data.BARCODE = BarcodeDALObj.BARCODE; //data.NAME = BarcodeDALObj.NAME; //data.ENAME = BarcodeDALObj.ENAME; //data.ABBNAME = BarcodeDALObj.ABBNAME; //data.PRODUCTGROUP = BarcodeDALObj.PRODUCTGROUP; //ABB.DAL.ProductGroupDAL groupDAL = new ABB.DAL.ProductGroupDAL(); //groupDAL.GetDataByLOID(MasterDALObj.PRODUCTGROUP, null); //data.PRODUCTTYPE = groupDAL.PRODUCTTYPE; data.COST = BarcodeDALObj.COST; //data.ISDISCOUNT = BarcodeDALObj.ISDISCOUNT; //data.ISEDIT = BarcodeDALObj.ISEDIT; //data.ISVAT = BarcodeDALObj.ISVAT; //data.LEADTIME = BarcodeDALObj.LEADTIME; //data.LOTSIZE = BarcodeDALObj.LOTSIZE; //data.LEADTIMEPD = BarcodeDALObj.LEADTIMEPD; //data.LOTSIZEPD = BarcodeDALObj.LOTSIZEPD; //data.ORDERTYPE = BarcodeDALObj.ORDERTYPE; data.PRICE = BarcodeDALObj.PRICE; //data.REGISNO = BarcodeDALObj.REGISNO; //data.STDPRICE = BarcodeDALObj.STDPRICE; data.UNIT = BarcodeDALObj.UNIT; //data.ISREFUND = BarcodeDALObj.ISREFUND; //data.PACKSIZE = BarcodeDALObj.PACKSIZE; //data.PACKSIZEUNIT = BarcodeDALObj.PACKSIZEUNIT; //data.REMARK = BarcodeDALObj.REMARK; //data.AGE = BarcodeDALObj.AGE; } return data; }
public bool InsertData(string userID, ProductSearchData data) { bool ret = true; ValidateData(data); DALObj.NAME = data.NAME.Trim(); // DALObj.ABBNAME = data.ABBNAME.Trim(); DALObj.PRODUCTGROUP = data.PRODUCTGROUP; DALObj.ACTIVE = data.ACTIVE.Trim(); DALObj.BARCODE = data.BARCODE.Trim(); DALObj.CODE = data.CODE.Trim(); DALObj.COST = data.COST; // DALObj.ISDISCOUNT = data.ISDISCOUNT.Trim(); // DALObj.ISEDIT = data.ISEDIT.Trim(); // DALObj.ISVAT = data.ISVAT.Trim(); DALObj.LEADTIME = data.LEADTIME; DALObj.LOTSIZE = data.LOTSIZE; DALObj.LEADTIMEPD = data.LEADTIMEPD; DALObj.LOTSIZEPD = data.LOTSIZEPD; DALObj.ORDERTYPE = data.ORDERTYPE.Trim(); DALObj.PRICE = data.PRICE; DALObj.REGISNO = data.REGISNO.Trim(); DALObj.STDPRICE = data.STDPRICE; DALObj.UNIT = data.UNIT; DALObj.ABBNAME = data.ABBNAME; OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { ret = DALObj.InsertCurrentData(userID, obj.zTrans); _LOID = DALObj.LOID; if (!ret) { throw new ApplicationException(DALObj.ErrorMessage); } obj.zTrans.Commit(); obj.CloseConnection(); } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; throw new ApplicationException(ex.Message); } return ret; }
public ProductSearchData GetData(double loid) { ProductSearchData data = new ProductSearchData(); if (DALObj.GetDataByLOID(loid, null)) { data.LOID = DALObj.LOID; data.ACTIVE = DALObj.ACTIVE; data.BARCODE = DALObj.BARCODE; data.CODE = DALObj.CODE; data.NAME = DALObj.NAME; data.ABBNAME = DALObj.ABBNAME; data.PRODUCTGROUP = DALObj.PRODUCTGROUP; ABB.DAL.ProductGroupDAL groupDAL = new ABB.DAL.ProductGroupDAL(); groupDAL.GetDataByLOID(DALObj.PRODUCTGROUP, null); data.PRODUCTTYPE = groupDAL.PRODUCTTYPE; data.COST = DALObj.COST; data.ISDISCOUNT = DALObj.ISDISCOUNT; data.ISEDIT = DALObj.ISEDIT; data.ISVAT = DALObj.ISVAT; data.LEADTIME = DALObj.LEADTIME; data.LOTSIZE = DALObj.LOTSIZE; data.LEADTIMEPD = DALObj.LEADTIMEPD; data.LOTSIZEPD = DALObj.LOTSIZEPD; data.ORDERTYPE = DALObj.ORDERTYPE; data.PRICE = DALObj.PRICE; data.REGISNO = DALObj.REGISNO; data.STDPRICE = DALObj.STDPRICE; data.UNIT = DALObj.UNIT; data.ISREFUND = DALObj.ISREFUND; data.PACKSIZE = DALObj.PACKSIZE; data.PACKSIZEUNIT = DALObj.PACKSIZEUNIT; data.REMARK = DALObj.REMARK; } return data; }