Пример #1
0
        public bool UpdateEntity(Model.CustomerModel entity)
        {
            string sql = string.Format("update customer set name='{0}',birthday='{1}',address='{2}',telphone='{3}',totalMoney='{4}',remark='{5}' where id={6}",
                                       entity.Name, entity.Birthday, entity.Address, entity.Telphone, entity.TotalMoney, entity.Mark, entity.ID);

            return(MSSqlHelper.ExecuteNonQuery(MSSqlHelper.ConStr, CommandType.Text, sql, null) > 0);
        }
Пример #2
0
        //private int GetNewID()
        //{
        //    string sql = "select s_Customer.nextval from dual";
        //    return int.Parse(MSSqlHelper.ExecuteScalar(MSSqlHelper.ConStr, CommandType.Text, sql, null).ToString());
        //}

        public Model.CustomerModel AddEntity(Model.CustomerModel entity)
        {
            string sql = string.Format(@"insert into customer(name,birthday,address,telphone,totalMoney,remark) 
                                                    values({0},'{1}','{2}','{3}',{4},{5})", entity.Name, entity.Birthday, entity.Address, entity.Telphone, entity.TotalMoney, entity.Mark);

            if (MSSqlHelper.ExecuteNonQuery(MSSqlHelper.ConStr, CommandType.Text, sql, null) > 0)
            {
                return(entity);
            }
            else
            {
                return(null);
            }
        }
 private void InitializeData(Model.CustomerModel d)
 {
     this.d  = d;
     OldGuid = d.Guid;
     this.TextBox_Customer_Number.Text      = d.Number;
     this.TextBox_Customer_Name.Text        = d.Name;
     this.TextBox_Customer_Address.Text     = d.Address;
     this.TextBox_Customer_Area.Text        = d.Area;
     this.TextBox_Customer_Phone.Text       = d.Phone;
     this.TextBox_Customer_MobilePhone.Text = d.MobilePhone;
     this.TextBox_Customer_Fax.Text         = d.Fax;
     this.TextBox_Customer_Business.Text    = d.Business;
     this.TextBox_Customer_Clerk.Text       = d.Clerk;
     this.TextBox_Customer_DebtCeiling.Text = d.DebtCeiling.ToString();
     this.TextBox_Customer_Remark.Text      = d.Remark;
     OldAddTime = d.AddTime.ToString();
 }