예제 #1
0
        private IEnumerable <RequestMasterModel> GetRequestMasterDetails()
        {
            try
            {
                RequestMasterModel objRequestMaster = new RequestMasterModel();
                objRequestMaster.CM_Company_Code = _objcurrentInfo.GetCompanyCode();
                objRequestMaster.RM_Company_Code = _objcurrentInfo.GetCompanyCode();

                BLMaster objMaster = new BLMaster();
                return(objMaster.GetRequestMasterDetails(objRequestMaster));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj);
                return(null);
            }
        }
예제 #2
0
        /// <summary>
        /// Get DropCycle
        /// </summary>
        /// <returns></returns>
        public JsonResult GetCycles()
        {
            try
            {
                BLMaster           objMaster    = new BLMaster();
                RequestMasterModel objdropcycle = new RequestMasterModel();
                objdropcycle.CM_Company_Code = _objcurrentInfo.GetCompanyCode();
                IEnumerable <RequestMasterModel> lstdropdcycles = objMaster.GetDropCycle(objdropcycle);

                var DropCyclelist = (from division in lstdropdcycles.AsEnumerable()
                                     select new RequestMasterModel()
                {
                    Cycle_Name = division.Cycle_Name.ToString(),
                    Cycle_Code = division.Cycle_Code.ToString()
                }).ToList <RequestMasterModel>();
                return(Json(DropCyclelist));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj);
                return(null);
            }
        }
예제 #3
0
        //Insert and Update the RequestMaster
        public int InsertandUpdateforRequestMaster(string requestName, string requestCodeval, string requestEntity, string requestType, string creditLimit, string cycleCode, string Mode)
        {
            int      result = 0;
            BLMaster Master = new BLMaster();
            List <RequestMasterModel> lstRequestMaster = new List <RequestMasterModel>();

            try
            {
                if (Mode.ToUpper() == "I") // Insert Data
                {
                    RequestMasterModel objrequestMaster = new RequestMasterModel();
                    objrequestMaster.CM_Company_Code = _objcurrentInfo.GetCompanyCode();
                    objrequestMaster.Request_Name    = requestName;
                    objrequestMaster.Request_Entity  = requestEntity;
                    objrequestMaster.Request_Type    = requestType;
                    if (!string.IsNullOrEmpty(creditLimit))
                    {
                        objrequestMaster.Credit_Limit = creditLimit;
                    }
                    objrequestMaster.Cycle_Code    = cycleCode;
                    objrequestMaster.Record_Status = "1";
                    objrequestMaster.Created_By    = _objcurrentInfo.GetUserName();
                    objrequestMaster.Created_Date  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");
                    lstRequestMaster.Add(objrequestMaster);
                    result = Master.InsertforRequestMaster(lstRequestMaster);
                    return(result);
                }
                else
                {
                    RequestMasterModel objrequestMaster = new RequestMasterModel();
                    objrequestMaster.CM_Company_Code = _objcurrentInfo.GetCompanyCode();
                    objrequestMaster.Request_Name    = requestName;
                    objrequestMaster.Request_Entity  = requestEntity;
                    objrequestMaster.Request_Type    = requestType;
                    if (!string.IsNullOrEmpty(creditLimit))
                    {
                        objrequestMaster.Credit_Limit = creditLimit;
                    }
                    objrequestMaster.Cycle_Code   = cycleCode;;
                    objrequestMaster.Request_Code = requestCodeval;
                    objrequestMaster.Updated_By   = _objcurrentInfo.GetUserName();
                    objrequestMaster.Updated_Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");
                    lstRequestMaster.Add(objrequestMaster);
                    result = Master.UpdateforRequestMaster(lstRequestMaster);
                    return(result);
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:requestName", requestName);
                dicContext.Add("Filter:requestCodeval", requestCodeval);
                dicContext.Add("Filter:requestEntity", requestEntity);
                dicContext.Add("Filter:Mode", Mode);
                dicContext.Add("Filter:requestType", requestType);
                dicContext.Add("Filter:creditLimit", creditLimit);
                dicContext.Add("Filter:cycleCode", cycleCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(0);
            }
        }