Exemplo n.º 1
0
        protected override void PrepareAddMain(int lgIndex, SqlCommand cmd, object t)
        {
            MB_Material_LensClass_Design model = t as MB_Material_LensClass_Design;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into B_Material_LensClass_Design(");
            strSql.Append("KeyCode,KeyName,SN)");
            strSql.Append(" values (");
            strSql.Append("@KeyCode,@KeyName,@SN)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@KeyCode", SqlDbType.VarChar,  10),
                new SqlParameter("@KeyName", SqlDbType.NVarChar, 30),
                new SqlParameter("@SN",      SqlDbType.Int, 4)
            };
            parameters[0].Value = model.KeyCode;
            parameters[1].Value = model.KeyName;
            parameters[2].Value = model.SN;
            cmd.ExecuteMyQuery(strSql.ToString(), parameters);
        }
Exemplo n.º 2
0
        protected override string GetPKCodeValue <T>(T t)
        {
            MB_Material_LensClass_Design model = t as MB_Material_LensClass_Design;

            return(model.KeyCode);
        }
Exemplo n.º 3
0
 public void Update(string dbCode, int lgIndex, MB_Material_LensClass_Design t)
 {
     bll.Update(dbCode, lgIndex, t, false);
 }
Exemplo n.º 4
0
 public string Add(string dbCode, int lgIndex, MB_Material_LensClass_Design t)
 {
     return(bll.Add(dbCode, lgIndex, t, false));
 }