Пример #1
0
        public override void FillTheTable(AmbleClient.OfferGui.OfferMgr.Offer offer)
        {
            offerId = offer.offerId;

            base.FillTheTable(offer);
            tbVendorName.Text = offer.vendorName;
            tbContact.Text    = offer.contact;
            tbPhone.Text      = offer.phone;
            tbFax.Text        = offer.fax;
            tbEmail.Text      = offer.email;
        }
Пример #2
0
        public Offer GetValue()
        {
            Offer offer = new Offer();
               offer.mpn = tbMpn.Text.Trim();
               offer.mfg = tbMfg.Text.Trim();
               offer.vendorName = tbVendorName.Text.Trim();
               offer.contact = tbContact.Text.Trim();
               offer.phone = tbPhone.Text.Trim();
               offer.fax = tbFax.Text.Trim();
               offer.email = tbEmail.Text.Trim();
               if (string.IsNullOrWhiteSpace(tbQuantity.Text.Trim()))
               {
               offer.amount = null;
               }
               else
               {
               offer.amount = int.Parse(tbQuantity.Text.Trim());
               }

               if (string.IsNullOrWhiteSpace(tbPrice.Text.Trim()))
               {
               offer.price = null;
               }
               else
               {
               offer.price = float.Parse(tbPrice.Text.Trim());
               }
               if (string.IsNullOrWhiteSpace(tbDeliverTime.Text.Trim()))
               {
               offer.deliverTime = null;

               }
               else
               {
               offer.deliverTime = int.Parse(tbDeliverTime.Text.Trim());
               }
               offer.timeUnit = cbTimeUnit.SelectedIndex;
               offer.buyerId = UserInfo.UserId;

               offer.offerDate = DateTime.Now;
               offer.offerStates = 0;//new
               offer.notes = tbNotes.Text.Trim();

               return offer;
        }
Пример #3
0
        public Offer GetValue()
        {
            Offer offer = new Offer();
               offer.mpn = tbMpn.Text.Trim().ToUpper();
               offer.mfg = tbMfg.Text.Trim().ToUpper();
               offer.vendorName = tbVendorName.Text.Trim();
               offer.contact = tbContact.Text.Trim();
               offer.phone = tbPhone.Text.Trim();
               offer.fax = tbFax.Text.Trim();
               offer.email = tbEmail.Text.Trim();
               offer.packing = tbPacking.Text.Trim();
               offer.quantity = int.Parse(tbQuantity.Text.Trim());
               offer.price = float.Parse(tbPrice.Text.Trim());
            offer.LT = tbDeliverTime.Text.Trim();

               offer.buyerId = UserInfo.UserId;

               offer.offerDate = DateTime.Now;
               offer.offerStates = 0;//new
               offer.notes = tbNotes.Text.Trim();

               return offer;
        }
Пример #4
0
        public static void UpdateOffer(Offer offer)
        {
            string strSql = string.Format("update offer set mpn='{0}',mfg='{1}',vendorName='{2}',contact='{3}',phone='{4}',fax='{5}',email='{6}',quantity={7},price={8},LT='{9}',buyerId={10},notes='{11}',packing='{12}', where offerId={13} ",
              offer.mpn, offer.mfg, offer.vendorName, offer.contact,offer.phone, offer.fax, offer.email, offer.quantity, offer.price, offer.LT,offer.buyerId, offer.notes,offer.packing,offer.offerId);

             db.ExecDataBySql(strSql);
        }
Пример #5
0
        public static bool SaveOffer(Offer offer)
        {
            string strSql = "insert into offer(rfqNo,mpn,mfg,vendorName,contact,phone,fax,email,quantity,price,LT,buyerId,offerDate,offerStates,notes,packing) " +
               string.Format(" values({0},'{1}','{2}','{3}','{4}','{5}','{6}','{7}',{8},{9},'{10}',{11},'{12}',{13},'{14}','{15}')", offer.rfqNo, offer.mpn, offer.mfg, offer.vendorName, offer.contact,
               offer.phone, offer.fax, offer.email, offer.quantity, offer.price, offer.LT,offer.buyerId, offer.offerDate.ToShortDateString(), offer.offerStates,offer.notes,offer.packing);

               int row = db.ExecDataBySql(strSql);
               if (row == 1)
               return true;
               else
               return false;
        }
Пример #6
0
        public void UpdateOffer(Offer offer)
        {
            string strSql = string.Format("update offer set mpn='{0}',mfg='{1}',vendorName='{2}',contact='{3}',phone='{4}',fax='{5}',email='{6}',amount={7},price={8},deliverTime='{9}',timeUnit={10},buyerId={11},notes='{12}' where offerId={13} ",
              offer.mpn, offer.mfg, offer.vendorName, offer.contact,offer.phone, offer.fax, offer.email, offer.amount.HasValue ? offer.amount.Value.ToString() : "null", offer.price.HasValue ? offer.price.ToString() : "null", offer.deliverTime.HasValue ? offer.deliverTime.Value.ToString() : "null", offer.timeUnit, offer.buyerId, offer.notes,offer.offerId);

             db.ExecDataBySql(strSql);
        }
Пример #7
0
        public bool SaveOffer(Offer offer)
        {
            string strSql = "insert into offer(rfqNo,mpn,mfg,vendorName,contact,phone,fax,email,amount,price,deliverTime,timeUnit,buyerId,offerDate,offerStates,notes) " +
               string.Format(" values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}',{9},{10},{11},{12},'{13}',{14})", offer.rfqNo, offer.mpn, offer.mfg, offer.vendorName, offer.contact,
               offer.phone, offer.fax, offer.email, offer.amount.HasValue?offer.amount.Value.ToString():"null", offer.price.HasValue?offer.price.ToString():"null", offer.deliverTime.HasValue? offer.deliverTime.Value.ToString():"null", offer.timeUnit, offer.buyerId, offer.offerDate.ToShortDateString(), offer.offerStates,offer.notes);

               int row = db.ExecDataBySql(strSql);
               if (row == 1)
               return true;
               else
               return false;
        }
Пример #8
0
        public virtual void FillTheTable(Offer offer)
        {
            this.tbMpn.Text = offer.mpn;
            this.tbMfg.Text = offer.mfg;

            this.tbQuantity.Text = offer.quantity.ToString();
            this.tbPrice.Text = offer.price.ToString();
            this.tbDeliverTime.Text = offer.LT;
            this.tbPacking.Text = offer.packing;
            this.tbOfferDate.Text = offer.offerDate.ToShortDateString();
            this.tbOfferState.Text = Enum.GetName(typeof(OfferState), (OfferState)offer.offerStates); //(offer.offerStates == 0 ? "New" : "Routed");
            this.tbNotes.Text = offer.notes;
        }