예제 #1
0
        /// <summary>
        /// 创建新的 custvendorinfo 对象。
        /// </summary>
        /// <param name="cvId">cvId 属性的初始值。</param>
        public static custvendorinfo Createcustvendorinfo(global::System.Int32 cvId)
        {
            custvendorinfo custvendorinfo = new custvendorinfo();

            custvendorinfo.cvId = cvId;
            return(custvendorinfo);
        }
예제 #2
0
        public static void UpateCvInfo(custvendorinfo cvInfo)
        {
            //获得数据库中的数据
            custvendorinfo selectedcvInfo = custVenEntity.custvendorinfo.First(cv => cv.cvId == cvInfo.cvId);

            selectedcvInfo.cvname         = cvInfo.cvname;
            selectedcvInfo.cvnumber       = cvInfo.cvnumber;
            selectedcvInfo.amount         = cvInfo.amount;
            selectedcvInfo.billTo         = cvInfo.billTo;
            selectedcvInfo.blacklisted    = cvInfo.blacklisted;
            selectedcvInfo.cellphone      = cvInfo.cellphone;
            selectedcvInfo.contact1       = cvInfo.contact1;
            selectedcvInfo.contact2       = cvInfo.contact2;
            selectedcvInfo.country        = cvInfo.country;
            selectedcvInfo.email1         = cvInfo.email1;
            selectedcvInfo.email2         = cvInfo.email2;
            selectedcvInfo.fax            = cvInfo.fax;
            selectedcvInfo.lastUpdateDate = DateTime.Now;
            selectedcvInfo.lastUpdateName = (short)UserInfo.UserId;
            selectedcvInfo.notes          = cvInfo.notes;
            selectedcvInfo.paymentTerm    = cvInfo.paymentTerm;
            selectedcvInfo.phone1         = cvInfo.phone1;
            selectedcvInfo.phone2         = cvInfo.phone2;
            selectedcvInfo.rate           = cvInfo.rate;
            selectedcvInfo.shippingTerm   = cvInfo.shippingTerm;
            selectedcvInfo.productLine    = cvInfo.productLine;

            custVenEntity.SaveChanges();
        }
예제 #3
0
 public CustVenView(custvendorinfo info)
 {
     this.info = info;
     InitializeComponent();
     if (info.cvtype == 0)
         this.Text = "Customer Info";
     else
         this.Text = "Vendor Info";
 }
예제 #4
0
        /// <summary>
        /// 创建新的 custvendorinfo 对象。
        /// </summary>
        /// <param name="cvId">cvId 属性的初始值。</param>
        /// <param name="cvtype">cvtype 属性的初始值。</param>
        /// <param name="cvname">cvname 属性的初始值。</param>
        /// <param name="ownerName">ownerName 属性的初始值。</param>
        public static custvendorinfo Createcustvendorinfo(global::System.Int32 cvId, global::System.SByte cvtype, global::System.String cvname, global::System.Int16 ownerName)
        {
            custvendorinfo custvendorinfo = new custvendorinfo();

            custvendorinfo.cvId      = cvId;
            custvendorinfo.cvtype    = cvtype;
            custvendorinfo.cvname    = cvname;
            custvendorinfo.ownerName = ownerName;
            return(custvendorinfo);
        }
예제 #5
0
 public void FillTheTextboxs(custvendorinfo cvinfo)
 {
     //Bind the info of Datarow to control
     tbName.Text = cvinfo.cvname;
     tbCountry.Text = cvinfo.country;
     tbRating.Text = cvinfo.rate.ToString();
     tbContact1.Text = cvinfo.contact1;
     tbContact2.Text = cvinfo.contact2;
     tbPhone1.Text = cvinfo.phone1;
     tbPhone2.Text = cvinfo.phone2;
     tbCell.Text = cvinfo.cellphone;
     tbFax.Text = cvinfo.fax;
     tbEmail1.Text = cvinfo.email1;
     tbEmail2.Text = cvinfo.email2;
     tbLastUpdateName.Text = cvinfo.lastUpdateName.HasValue?AmbleClient.Admin.AccountMgr.AccountMgr.GetNameById(cvinfo.lastUpdateName.Value):"";
     tbLastUpdateDate.Text = cvinfo.lastUpdateDate.HasValue?cvinfo.lastUpdateDate.Value.ToShortDateString():"";
     tbAmount.Text = cvinfo.amount.ToString();
     tbNotes.Text = cvinfo.notes;
     comboBox2.SelectedIndex = cvinfo.blacklisted.HasValue? cvinfo.blacklisted.Value : -1;
     tbProductLine.Text = cvinfo.productLine;
 }
예제 #6
0
        public custvendorinfo GetValues()
        {
            custvendorinfo cvInfo = new custvendorinfo();
            cvInfo.cvtype = (sbyte)this.cvtype;
            cvInfo.cvname = tbName.Text.Trim();
            cvInfo.country = tbCountry.Text.Trim();
            if (tbRating.Text.Trim().Length == 0)
            {
                cvInfo.rate = null;
            }
            else
            {
                cvInfo.rate = Convert.ToSByte(tbRating.Text.Trim());
            }
            cvInfo.contact1 = tbContact1.Text.Trim();
            cvInfo.contact2 = tbContact2.Text.Trim();
            cvInfo.phone1 = tbPhone1.Text.Trim();
            cvInfo.phone2 = tbPhone2.Text.Trim();
            cvInfo.cellphone = tbCell.Text.Trim();
            cvInfo.fax = tbFax.Text.Trim();
            cvInfo.email1 = tbEmail1.Text.Trim();
            cvInfo.email2 = tbEmail2.Text.Trim();
            if (tbAmount.Text.Trim().Length == 0)
            {
                cvInfo.amount = null;
            }
            else
            {
                cvInfo.amount = Convert.ToInt32(tbAmount.Text.Trim());
            }
            cvInfo.notes = tbNotes.Text.Trim();
            cvInfo.blacklisted = (sbyte)comboBox2.SelectedIndex;
            cvInfo.productLine = tbProductLine.Text.Trim();

            return cvInfo;
        }
예제 #7
0
 /// <summary>
 /// 用于向 custvendorinfo EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddTocustvendorinfo(custvendorinfo custvendorinfo)
 {
     base.AddObject("custvendorinfo", custvendorinfo);
 }
예제 #8
0
 /// <summary>
 /// 创建新的 custvendorinfo 对象。
 /// </summary>
 /// <param name="cvId">cvId 属性的初始值。</param>
 public static custvendorinfo Createcustvendorinfo(global::System.Int32 cvId)
 {
     custvendorinfo custvendorinfo = new custvendorinfo();
     custvendorinfo.cvId = cvId;
     return custvendorinfo;
 }
예제 #9
0
 /// <summary>
 /// 用于向 custvendorinfo EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddTocustvendorinfo(custvendorinfo custvendorinfo)
 {
     base.AddObject("custvendorinfo", custvendorinfo);
 }
예제 #10
0
 public static void AddCustVend(custvendorinfo custVenInfo)
 {
     custVenEntity.custvendorinfo.AddObject(custVenInfo);
     custVenEntity.SaveChanges();
 }