예제 #1
0
        public static string ShowCountry(M_Order_Contact model)
        {
            string text = model.Country.ToLower();

            if (text.Contains("canada"))
            {
                return("CANADA");
            }
            return("USA");
        }
예제 #2
0
        public M_Order_Contact GetModelFromReader(DbDataReader rdr)
        {
            M_Order_Contact model = new M_Order_Contact();

            model.ID       = ConvertToInt(rdr["ID"]);
            model.OrderID  = ConvertToInt(rdr["OrderID"]);
            model.FullName = ConverToStr(rdr["FullName"]);
            model.Email    = ConverToStr(rdr["Email"]);
            model.Address  = ConverToStr(rdr["Address"]);
            model.City     = ConverToStr(rdr["City"]);
            model.State    = ConverToStr(rdr["State"]);
            model.Country  = ConverToStr(rdr["Country"]);
            model.Zip      = ConverToStr(rdr["Zip"]);
            model.Phone    = ConverToStr(rdr["Phone"]);
            model.CDate    = ConvertToDate(rdr["CDate"]);
            model.Remark   = ConverToStr(rdr["Remark"]);
            rdr.Close();
            return(model);
        }
예제 #3
0
        public override SqlParameter[] GetParameters()
        {
            M_Order_Contact model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.OrderID;
            sp[2].Value  = model.FullName;
            sp[3].Value  = model.Email;
            sp[4].Value  = model.Address;
            sp[5].Value  = model.City;
            sp[6].Value  = model.State;
            sp[7].Value  = model.Country;
            sp[8].Value  = model.Zip;
            sp[9].Value  = model.Phone;
            sp[10].Value = model.CDate;
            sp[11].Value = model.Remark;
            return(sp);
        }
예제 #4
0
        public static string ShowCityAndState(M_Order_Contact model)
        {
            string stateShort = ExHelper.GetStateShort(model.Country, model.State);

            return(string.Format("{0}, {1} {2}", model.City, stateShort, model.Zip.ToUpper()));
        }
예제 #5
0
 public bool UpdateByID(M_Order_Contact model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
예제 #6
0
 public int Insert(M_Order_Contact model)
 {
     //return Sql.insert(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
     return(DBCenter.Insert(model));
 }