Пример #1
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;
     }
 }
Пример #2
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;
            }
        }