示例#1
0
        public ContentResult GetContractPendingData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string searchprm)
        {
            ContractSearchpara ObjPara = JsonConvert.DeserializeObject <ContractSearchpara>(searchprm,
                                                                                            new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore
            });
            //T_CMS_Master_ContractCollection collection = T_CMS_Master_ContractManager.Search(SearchKey);

            DataTable dt          = T_CMS_Master_ContractManager.CMS_ContractPendingReport(int.Parse(ObjPara.EntityId), SystemConfig.CurrentDate, true);
            int       TotalRecord = 0;

            if (dt.Rows.Count > 0)
            {
                TotalRecord = dt.Rows.Count;
            }
            //{{Class}Collection data = {{Class}}Manager.GetAll(CurrentUser.CompanyID);
            IEnumerable <DataRow> rows = dt.AsEnumerable().ToList();
            object temp = new object();

            foreach (var item in rows)
            {
                temp = item.Table;
            }
            return(Content(JsonConvert.SerializeObject(new DataTablesResponseExtend(requestModel.Draw, temp, TotalRecord, TotalRecord)), "application/json"));
        }
示例#2
0
        public void ContractPendingReport(string searchprm)
        {
            ContractSearchpara ObjPara = JsonConvert.DeserializeObject <ContractSearchpara>(searchprm,
                                                                                            new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore
            });
            DataTable dt = new DataTable();

            try
            {
                bool isActive = false;
                if (ObjPara.IsActive != null && ObjPara.IsActive.ToLower() == "on")
                {
                    isActive = true;
                }
                dt = T_CMS_Master_ContractManager.CMS_ContractPendingReport(int.Parse(ObjPara.EntityId), null, isActive);
            }
            catch
            {
            }
            FileInputHelper.ExportExcel(dt, "Contract_Pending_" + SystemConfig.CurrentDate.ToShortDateString(), "Contract Pending List", false);
        }
示例#3
0
        public SearchFilter BindSearch(string searchprm)
        {
            SearchFilter SearchKey = new SearchFilter();

            SearchKey.OrderBy        = "ID";
            SearchKey.ColumnsName    = "ID,EmployeeCode,MiddleName_EN,LastName_EN,FirstName_EN,DeptID,ContractNo,HighestDegree";
            SearchKey.Page           = 1;
            SearchKey.PageSize       = 5000;
            SearchKey.OrderBy        = "ID";
            SearchKey.OrderDirection = "Desc";
            ContractSearchpara ObjPara = JsonConvert.DeserializeObject <ContractSearchpara>(searchprm,
                                                                                            new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore
            });
            string isactive         = "0";
            string strDefaultEntity = "10001";
            string strDefaultSearch = "  tbl.employeeCode not in (  select EmployeeCode from T_COM_Master_Employee_Position  where T_COM_Master_Employee_Position.IsAcitve=1) and ";

            if (ObjPara != null)
            {
                if (ObjPara.IsActive != null)
                {
                    isactive = "1";
                }
                else
                {
                    SearchKey.Condition = strDefaultSearch;
                }
                if (!string.IsNullOrEmpty(ObjPara.EntityId))
                {
                    strDefaultEntity = ObjPara.EntityId;
                }
                if (!string.IsNullOrEmpty(ObjPara.EmpCode))
                {
                    SearchKey.Condition += " (tbl.EmployeeCode like '%" + ObjPara.EmpCode + "%' or  tbl.ContractNo like '%" + ObjPara.EmpCode + "%') and ";
                }
                if (!string.IsNullOrEmpty(ObjPara.EmpName))
                {
                    SearchKey.Keyword = ObjPara.EmpName;
                    //SearchKey.Condition += " (tbl.LastName_EN + '' '' + tbl.MiddleName_EN + '' '' + tbl.FirstName_EN like ''%"+ ObjPara.EmpName + "%'') and ";
                }
                if (!string.IsNullOrEmpty(ObjPara.start))
                {
                    string[] startDate = ObjPara.start.Split('/');
                    string[] EnDate    = ObjPara.end.Split('/');
                    if (startDate.Length > 1)
                    {
                        string startD = startDate[2] + startDate[1] + startDate[0];
                        string EndD   = startD;
                        if (EnDate.Length > 1)
                        {
                            EndD = EnDate[2] + EnDate[1] + EnDate[0];
                        }
                        SearchKey.Condition += " (tbl.Joiningdate >='" + startD + "' and tbl.Joiningdate<='" + EndD + "') and ";
                    }
                }
            }
            SearchKey.Condition += " tbl.IsActive=" + isactive + " and T_COm_Master_Org.Entity_Id=" + strDefaultEntity + "   ";
            return(SearchKey);
        }