Example #1
0
 public static int Insert(kjcCompany model, out string errMsg)
 {
     sql.Length = rtn = 0;
     errMsg     = string.Empty;
     try
     {
         sql.Append("Insert Into kjcCompany ");
         sql.Append("(regId,regName,regCorpName,organizationCode,regAddress,regPost,contactMan,contactPhone,uDate) ");
         sql.AppendFormat("Values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')",
                          model.regId, model.regName, model.regCorpName, model.organizationCode, model.regAddress, model.regPost, model.contactMan, model.contactPhone, model.uDate);
         DataBase.ExecuteCommand(sql.ToString(), out errMsg);
         rtn = 1;
     }
     catch (Exception e)
     {
         errMsg = e.Message;
     }
     return(rtn);
 }
Example #2
0
        public static int Update(kjcCompany model, string where, out string errMsg)
        {
            sql.Length = rtn = 0;
            errMsg     = string.Empty;
            try
            {
                //添加where条件
                if (where.Length > 0)
                {
                    sql.AppendFormat(" Where {0}", where);
                }

                DataBase.ExecuteCommand(sql.ToString(), out errMsg);
                rtn = 1;
            }
            catch (Exception e)
            {
                errMsg = e.Message;
            }
            return(rtn);
        }