public String AddModifyUserOrder(ClsUserOrder ObjUserOrder) { using (ClsOrder_DAL obj = new ClsOrder_DAL()) { return(obj.AddModifyUserOrder(ObjUserOrder)); } }
public string AddModifyUserOrder(ClsUserOrder ObjUserOrder) { try { ClsCommon_DAL objCommon = new ClsCommon_DAL(); DBHelper objDbHelper = new DBHelper(); string Action = "", OrderCode = ""; if (ObjUserOrder.ObjectList[0].OrderID == 0) { OrderCode = objCommon.RandomString(10); } ObjUserOrder.ObjectList.ForEach(Object => { DBParameterCollection ObJParameterCOl = new DBParameterCollection(); DBParameter objDBParameter = new DBParameter("@UserID", Object.UserID, DbType.Int64); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@OrderID", Object.OrderID, DbType.Int64); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@OrderCode", OrderCode, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@ObjectID", Object.ObjectID, DbType.Int64); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@ObjectType", Object.ObjectType, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@IncludeProjectFile", Object.IncludeProjectFile, DbType.Boolean); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@OrderStatus", Object.OrderStatus, DbType.String); ObJParameterCOl.Add(objDBParameter); Action = Convert.ToString(objDbHelper.ExecuteScalar(Constant.AddModifyUserOrder, ObJParameterCOl, CommandType.StoredProcedure)); }); return(Action); } catch (Exception ex) { throw ex; } }