Exemplo n.º 1
0
 //
 public bool Update(LiceTran model)
 {
     try
     {
         StringBuilder strSql = new StringBuilder();
         strSql.Append("update T_LiceTran set ");
         strSql.Append("OrgCode=@OrgCode,");
         strSql.Append("MemberTypeId=@MemberTypeId,");
         strSql.Append("Name=@Name,");
         strSql.Append("Addr=@Addr,");
         strSql.Append("Contact=@Contact,");
         strSql.Append("Corporate=@Corporate,");
         strSql.Append("IDCard=@IDCard,");
         strSql.Append("OrganizationCode=@OrganizationCode,");
         strSql.Append("Tel=@Tel,");
         strSql.Append("Owner=@Owner,");
         strSql.Append("Capital=@Capital,");
         strSql.Append("ApplyDate=@ApplyDate,");
         strSql.Append("AuditType=@AuditType,");
         strSql.Append("FK_WebUserVeriId=@FK_WebUserVeriId,");
         strSql.Append("LiceTranType=@LiceTranType,");
         strSql.Append("JBYhm=@jbyhm,");
         strSql.Append("JBmm=@jbmm");
         strSql.Append(" where Id=@Id");
         if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }
Exemplo n.º 2
0
        //
        private dynamic GetModels(HttpContext context)
        {
            LiceTran model = new LiceTran();

            try { model.Id = int.Parse(context.Request.Form["Id"].ToString()); }
            catch { }
            try { model.LiceTranType = int.Parse(context.Request.Form["LiceTranType"].ToString()); }
            catch { model.LiceTranType = 1; }
            model.OrgCode = context.Request.Form["OrgCode"].ToString();
            try { model.MemberTypeId = int.Parse(context.Request.Form["MemberTypeId"].ToString()); }
            catch { }
            model.Name             = context.Request.Form["Name"].ToString();
            model.Addr             = context.Request.Form["Addr"].ToString();
            model.Contact          = context.Request.Form["Contact"].ToString();
            model.Corporate        = context.Request.Form["Corporate"].ToString();
            model.IDCard           = context.Request.Form["IDCard"].ToString();
            model.OrganizationCode = context.Request.Form["OrganizationCode"].ToString();
            model.Tel     = context.Request.Form["Tel"].ToString();
            model.Owner   = context.Request.Form["Owner"].ToString();
            model.Capital = context.Request.Form["Capital"].ToString();
            try { model.ApplyDate = DateTime.Parse(context.Request.Form["ApplyDate"].ToString()); }
            catch { }
            try { model.AuditType = int.Parse(context.Request.Form["AuditType"].ToString()); }
            catch { }
            try { model.FK_WebUserVeriId = user.Id; }
            catch { }
            return(model);
        }
Exemplo n.º 3
0
 //
 public dynamic GetModel(int Id)
 {
     try
     {
         LiceTran      model  = null;
         StringBuilder strSql = new StringBuilder();
         strSql.Append("select Id,OrgCode,MemberTypeId,Name,Addr,Contact,Corporate,IDCard,OrganizationCode,Tel,Owner,Capital,ApplyDate,AuditType,LiceTranType,FK_WebUserVeriId,jbyhm,jbmm from T_LiceTran ");
         strSql.Append(" where Id=@Id");
         SqlParameter[] parameters =
         {
             new SqlParameter("@Id", SqlDbType.Int, 4)
         };
         parameters[0].Value = Id;
         using (dynamic read = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters))
         {
             if (read.Read())
             {
                 model = new LiceTran();
                 try { model.Id = int.Parse(read["Id"].ToString()); }
                 catch { }
                 model.OrgCode = read["OrgCode"].ToString();
                 try { model.MemberTypeId = int.Parse(read["MemberTypeId"].ToString()); }
                 catch { }
                 model.Name             = read["Name"].ToString();
                 model.Addr             = read["Addr"].ToString();
                 model.Contact          = read["Contact"].ToString();
                 model.Corporate        = read["Corporate"].ToString();
                 model.IDCard           = read["IDCard"].ToString();
                 model.OrganizationCode = read["OrganizationCode"].ToString();
                 model.Tel     = read["Tel"].ToString();
                 model.Owner   = read["Owner"].ToString();
                 model.Capital = read["Capital"].ToString();
                 try { model.ApplyDate = DateTime.Parse(read["ApplyDate"].ToString()); }
                 catch { }
                 try { model.AuditType = int.Parse(read["AuditType"].ToString()); }
                 catch { }
                 try { model.LiceTranType = int.Parse(read["LiceTranType"].ToString()); }
                 catch { }
                 try { model.FK_WebUserVeriId = int.Parse(read["FK_WebUserVeriId"].ToString()); }
                 catch { }
                 try { model.JBYhm = read["jbyhm"].ToString(); }
                 catch { }
                 try { model.JBmm = read["jbmm"].ToString(); }
                 catch { }
             }
             read.Dispose();
         }
         return(model);
     }
     catch { throw; }
 }
Exemplo n.º 4
0
 //
 private SqlParameter[] GetSqlParameter(LiceTran model)
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@OrgCode",          SqlDbType.NVarChar,  100),
         new SqlParameter("@MemberTypeId",     SqlDbType.Int,         4),
         new SqlParameter("@Name",             SqlDbType.NVarChar,  100),
         new SqlParameter("@Addr",             SqlDbType.NVarChar,  100),
         new SqlParameter("@Contact",          SqlDbType.NVarChar,  100),
         new SqlParameter("@Corporate",        SqlDbType.NVarChar,  100),
         new SqlParameter("@IDCard",           SqlDbType.NVarChar,  100),
         new SqlParameter("@OrganizationCode", SqlDbType.NVarChar,  100),
         new SqlParameter("@Tel",              SqlDbType.NVarChar,  100),
         new SqlParameter("@Owner",            SqlDbType.NVarChar,  100),
         new SqlParameter("@Capital",          SqlDbType.NVarChar,  100),
         new SqlParameter("@ApplyDate",        SqlDbType.DateTime),
         new SqlParameter("@AuditType",        SqlDbType.Int,         4),
         new SqlParameter("@LiceTranType",     SqlDbType.Int,         4),
         new SqlParameter("@Id",               SqlDbType.Int,         4),
         new SqlParameter("@FK_WebUserVeriId", SqlDbType.Int,         4),
         new SqlParameter("@JBYhm",            SqlDbType.VarChar,    50),
         new SqlParameter("@JBmm",             SqlDbType.VarChar, 50)
     };
     parameters[0].Value  = model.OrgCode;
     parameters[1].Value  = model.MemberTypeId;
     parameters[2].Value  = model.Name;
     parameters[3].Value  = model.Addr;
     parameters[4].Value  = model.Contact;
     parameters[5].Value  = model.Corporate;
     parameters[6].Value  = model.IDCard;
     parameters[7].Value  = model.OrganizationCode;
     parameters[8].Value  = model.Tel;
     parameters[9].Value  = model.Owner;
     parameters[10].Value = model.Capital;
     parameters[11].Value = model.ApplyDate;
     parameters[12].Value = model.AuditType;
     parameters[13].Value = model.LiceTranType;
     parameters[14].Value = model.Id;
     parameters[15].Value = model.FK_WebUserVeriId;
     parameters[16].Value = model.JBYhm;
     parameters[17].Value = model.JBmm;
     return(parameters);
 }
Exemplo n.º 5
0
 //
 public bool Create(LiceTran model)
 {
     try
     {
         StringBuilder strSql = new StringBuilder();
         strSql.Append("insert into T_LiceTran(");
         strSql.Append("OrgCode,MemberTypeId,Name,Addr,Contact,Corporate,IDCard,OrganizationCode,Tel,Owner,Capital,ApplyDate,AuditType,LiceTranType,FK_WebUserVeriId,jbyhm,jbmm)");
         strSql.Append(" values (");
         strSql.Append("@OrgCode,@MemberTypeId,@Name,@Addr,@Contact,@Corporate,@IDCard,@OrganizationCode,@Tel,@Owner,@Capital,@ApplyDate,@AuditType,@LiceTranType,@FK_WebUserVeriId,@JBYhm,@JBmm)");
         if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }