Пример #1
0
        public static List<Dictionary<string, object>> action_(string imode, string status, string remarks, string id)
        {
            DataSet ds = new DataSet();
            List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
            Dictionary<string, object> row = new Dictionary<string, object>();
            try
            {
                bel_Approval obj_bel_Approval = new bel_Approval();
                dal_Approval obj_dal_Approval = new dal_Approval();
                obj_bel_Approval._iMode = imode;
                obj_bel_Approval._ID = Convert.ToInt16(id);
                if (imode != "IndentClosingStatus")
                    obj_bel_Approval._ApprovedStatus = Convert.ToInt16(status);
                else
                    obj_bel_Approval._Closing = status;

                obj_bel_Approval._Remarks = remarks.Trim();
                using (ds = obj_dal_Approval.dal_ApprovalDetail(obj_bel_Approval))
                {
                    row.Add("res", ds.Tables[0].Rows[0][0].ToString());
                    rows.Add(row);
                    return rows;
                }
            }
            catch (Exception ex)
            {
                row.Add("res", "exception");
                rows.Add(row);
                return rows;
            }
        }
Пример #2
0
 public static List<Dictionary<string, object>> search_(string imode, string frmdate, string todate, string id)
 {
     DataSet ds = new DataSet();
     List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
     Dictionary<string, object> row = new Dictionary<string, object>();
     try
     {
         bel_Approval obj_bel_Approval = new bel_Approval();
         dal_Approval obj_dal_Approval = new dal_Approval();
         obj_bel_Approval._iMode = imode;
         obj_bel_Approval._ID = Convert.ToInt16(id);
         if (frmdate != null && todate != null && frmdate != "" && todate != "")
         {
             obj_bel_Approval._FromDate = Convert.ToDateTime(frmdate);
             obj_bel_Approval._ToDate = Convert.ToDateTime(todate);
         }
         using (ds = obj_dal_Approval.dal_ApprovalDetail(obj_bel_Approval))
         {
             return Json.getjson_(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         row.Add("res", "exception");
         rows.Add(row);
         return rows;
     }
 }
Пример #3
0
        public DataSet dal_ApprovalDetail(bel_Approval obj_bel_Approval)
        {
            DataSet ds = new DataSet();
               try
               {
               SqlCommand sqlcmd = new SqlCommand("spu_Approval");
               sqlcmd.CommandTimeout = 0;
               sqlcmd.CommandType = CommandType.StoredProcedure;
               sqlcmd.Parameters.Clear();
               sqlcmd.Parameters.AddWithValue("@NO", obj_bel_Approval._NO);
               sqlcmd.Parameters.AddWithValue("@ID", obj_bel_Approval._ID);
               sqlcmd.Parameters.AddWithValue("@ApprovedStatus", obj_bel_Approval._ApprovedStatus);
               sqlcmd.Parameters.AddWithValue("@Remarks", obj_bel_Approval._Remarks);
               sqlcmd.Parameters.AddWithValue("@ApprovedUserID", Convert.ToInt32(HttpContext.Current.Session["UserID"]));
               sqlcmd.Parameters.AddWithValue("@iMode", obj_bel_Approval._iMode);
               sqlcmd.Parameters.AddWithValue("@BranchID", Convert.ToInt32(HttpContext.Current.Session["BranchID"]));
               sqlcmd.Parameters.AddWithValue("@CompanyID", Convert.ToInt32(HttpContext.Current.Session["CompanyID"]));
               sqlcmd.Parameters.AddWithValue("@FromDate", obj_bel_Approval._FromDate);
               sqlcmd.Parameters.AddWithValue("@ToDate", obj_bel_Approval._ToDate);
               sqlcmd.Parameters.AddWithValue("@Closing", obj_bel_Approval._Closing);
               ds = DataFunctions.GetDataSet(sqlcmd);
               }
               catch (Exception ex)
               {

               }
               return ds;
        }