예제 #1
0
        protected override void PrepareAddMain(int lgIndex, SqlCommand cmd, object t)
        {
            MB_Material_LensClass_Materials model = t as MB_Material_LensClass_Materials;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into B_Material_LensClass_Materials(");
            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);
        }
 public void Update(string dbCode, int lgIndex, MB_Material_LensClass_Materials t)
 {
     bll.Update(dbCode, lgIndex, t, false);
 }
 public string Add(string dbCode, int lgIndex, MB_Material_LensClass_Materials t)
 {
     return(bll.Add(dbCode, lgIndex, t, false));
 }
        protected override string GetPKCodeValue <T>(T t)
        {
            MB_Material_LensClass_Materials model = t as MB_Material_LensClass_Materials;

            return(model.KeyCode);
        }