/// <summary> /// 新增独立单位 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Add_Wages(WagesEntity model) { SqlParameter[] parameters = { new SqlParameter("vdeptname", SqlDbType.VarChar, 30), new SqlParameter("vmembername", SqlDbType.VarChar, 50), new SqlParameter("vwagesclass", SqlDbType.VarChar, 50), new SqlParameter("vwagesname", SqlDbType.VarChar, 60), new SqlParameter("vwagesbz", SqlDbType.VarChar, 100), new SqlParameter("vcyear", SqlDbType.VarChar, 30), new SqlParameter("vjanplan", SqlDbType.Decimal), new SqlParameter("vfebplan", SqlDbType.Decimal), new SqlParameter("vmarplan", SqlDbType.Decimal), new SqlParameter("vaprplan", SqlDbType.Decimal), new SqlParameter("vmayplan", SqlDbType.Decimal), new SqlParameter("vjunplan", SqlDbType.Decimal), new SqlParameter("vjulplan", SqlDbType.Decimal), new SqlParameter("vaugplan", SqlDbType.Decimal), new SqlParameter("vsepplan", SqlDbType.Decimal), new SqlParameter("voctplan", SqlDbType.Decimal), new SqlParameter("vnovplan", SqlDbType.Decimal), new SqlParameter("vdecplan", SqlDbType.Decimal) }; parameters[0].Value = model.DeptName; parameters[1].Value = model.MemberName; parameters[2].Value = model.WagesClass; parameters[3].Value = model.WagesName; parameters[4].Value = model.WagesBz; parameters[5].Value = model.cYear; parameters[6].Value = model.JanPlan; parameters[7].Value = model.FebPlan; parameters[8].Value = model.MarPlan; parameters[9].Value = model.AprPlan; parameters[10].Value = model.MayPlan; parameters[11].Value = model.JunPlan; parameters[12].Value = model.JulPlan; parameters[13].Value = model.AugPlan; parameters[14].Value = model.SepPlan; parameters[15].Value = model.OctPlan; parameters[16].Value = model.NovPlan; parameters[17].Value = model.DecPlan; string commandText = "proc_AddWages"; int result = 0; try { db.Open(); // string strHtml = "select 1 from T_Wages where DeptName='" + model.DeptName + "' and WagesClass='" + model.WagesClass + "'and cYear='" + model.cYear + "'"; // DataTable dt = new DataTable(); //dt = db.GetDataTableWithSQL(strHtml); //if (dt.Rows.Count > 0) //{ // result = 2; // } //else //{ db.ExecuteNonQuery(commandText, CommandType.StoredProcedure, parameters); result = 1; // } } catch //(InvalidOperationException ex) { result = 0; } finally { db.Close(); } return(result); }
/// <summary> /// 新增独立单位 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Add_Wages(WagesEntity model) { return(dalWages.Add_Wages(model)); }