Exemple #1
0
        public HttpResponseMessage GetServices()
        {
            GlobalVarible.Clear();
            List <ENT.ServiceMasterView> lstEntity = new List <ENT.ServiceMasterView>();

            try
            {
                using (BAL.ServiceMaster objBal = new BAL.ServiceMaster())
                {
                    lstEntity = objBal.GetServices("30B24352-9F4B-485A-AB18-528E74F6F260");
                }

                foreach (ENT.ServiceMasterView s in lstEntity)
                {
                    s.serviceimage = "http://dmt.appsmith.co.in/Uploads/Services/postpaid.png";
                }

                GlobalVarible.AddMessage("Services get successfully.");
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }
        public JsonResult GetTransferCharge(moneytransfermodel model)
        {
            GlobalVarible.Clear();

            var loginuser = User.Identity.GetUserId();

            string transferCharge = "-1";

            try
            {
                using (BAL.DMT_MoneyRemittance objTranfer = new BAL.DMT_MoneyRemittance())
                {
                    MEMBERS.SQLReturnMessageNValue retVal = objTranfer.DMT_GetCharge(model.transferamount.ToString(), _LoginUserId, (int)User.GetUserlevel());
                    if (retVal.Outval == 1)
                    {
                        transferCharge = retVal.Outmsg;
                        GlobalVarible.AddMessage("Transfer Charge Get Successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError(retVal.Outmsg);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            return(Json(new { MySession.Current.MessageResult, transferCharge }, JsonRequestBehavior.AllowGet));
        }
 public JsonResult IsEnabledActivity(bool id)
 {
     try
     {
         ENT.IsEnabledApiCall model2 = new ENT.IsEnabledApiCall();
         BAL.IsEnabledApiCall objBAL = new BAL.IsEnabledApiCall();
         if (id == true || id == false)
         {
             model2.Isenabled  = id;
             model2.ipaddress  = new GenralGetIp().GetIPAddress(Request);
             model2.userid     = Guid.Parse(User.Identity.GetUserId());
             model2.enabletext = (id == true ? "ON" : "OFF");
             if (objBAL.Insert(model2))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
 public JsonResult UpdateStatus(string id)
 {
     GlobalVarible.Clear();
     try
     {
         if (id != null)
         {
             Model       = new Web.Framework.Entity.SMSMaster();
             Model.smsid = new Guid(id);
             Model       = (ENT.SMSMaster)objBAL.GetByPrimaryKey(Model);
             if (Model.Status == COM.MyEnumration.MyStatus.Active)
             {
                 if (!objBAL.UpdateStatus(Model.smsid, COM.MyEnumration.MyStatus.DeActive))
                 {
                     throw new Exception("Internal Server Error in status update.");
                 }
             }
             if (Model.Status == COM.MyEnumration.MyStatus.DeActive)
             {
                 if (!objBAL.UpdateStatus(Model.smsid, COM.MyEnumration.MyStatus.Active))
                 {
                     throw new Exception("Internal Server Error in status update.");
                 }
             }
             GlobalVarible.AddMessage("Status Update Successfully.");
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
Exemple #5
0
 public HttpResponseMessage RegisterToken(ENT.UserDeviceToken modal)
 {
     GlobalVarible.Clear();
     try
     {
         using (BAL.UserDeviceToken objBal = new BAL.UserDeviceToken())
         {
             modal.udt_userid      = _LOGINUSERID;
             modal.CreatedBy       = _LOGINUSERID;
             modal.CreatedDateTime = DateTime.Now;
             if (objBal.Insert(modal))
             {
                 GlobalVarible.AddMessage("Token Registered Successfully.");
                 return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
             }
             else
             {
                 GlobalVarible.AddError("Unable to Add Token.Please Try Again");
                 ERRORREPORTING.Report(new Exception("Unable to Add Token.Please Try Again"), _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(modal));
                 return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
         ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(modal));
         return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
     }
 }
 [Authorize(Roles = "Administrator")]//Save Entry
 public JsonResult SaveEntry(ENT.CountryMasterSUB model, string CountryID)
 {
     try
     {
         List <Guid> dctDuplication = new List <Guid>();
         if (model.EntryMode == COM.MyEnumration.EntryMode.ADD)
         {
             model.Status = COM.MyEnumration.MyStatus.Active;
             List <ENT.CountryMasterSUB> lstResult = new BAL.CountryMasterBAL().CheckDuplicateCombination(dctDuplication, COM.MyEnumration.MasterType.MainDeviceMaster, model.CountryName);
             if (lstResult.Count > 0)
             {
                 throw new Exception("Country Name Already Exists.");
             }
             if (objBAL.Insert(model))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
         else
         {
             model.CreatedDateTime = DateTime.Now;
             model.CountryID       = new Guid(CountryID.Replace("/", ""));
             if (objBAL.Update(model))
             {
                 GlobalVarible.AddMessage("Record Update Successfully");
             }
         }
     }
     catch (Exception ex)
     { GlobalVarible.AddError(ex.Message); }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
Exemple #7
0
        public JsonResult UpdateEntry(ENT.UserProfile model, string up_id)
        {
            try
            {
                model.UpdatedDateTime = DateTime.Now;
                model.UpdatedBy       = Guid.Parse(User.Identity.GetUserId());
                model.up_id           = new Guid(up_id.Replace("/", ""));
                if (objBAL.UpdatePartial(model))
                {
                    new BAL.MasterDistributor().UpdateSlab(model.slabid, model.up_id);
                    //string id = User.Identity.GetUserId();
                    //  ApplicationUser currentUser = UserManager.FindById(id);
                    var user = new ApplicationUser();
                    user.Email = model.up_email;

                    GlobalVarible.AddMessage("Record Update Successfully");
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
        //Get Sub Device List
        public JsonResult GetUserAndPlantMapping()
        {
            //jQuery DataTables Param
            var draw = Request.Form.GetValues("draw").FirstOrDefault();

            try
            {
                //Find paging info
                var start  = Request.Form.GetValues("start").FirstOrDefault();
                var length = Request.Form.GetValues("length").FirstOrDefault();
                //Find order columns info
                var sortColumn    = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][data]").FirstOrDefault();
                var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();
                var search        = Request.Form.Get("search[value]").FirstOrDefault();

                int pageSize = length != null?Convert.ToInt32(length) : 0, skip = start != null?Convert.ToInt16(start) : 1;

                skip = (skip / pageSize) + 1;
                COM.TTPagination.isPageing = true;
                COM.TTPagination.PageSize  = pageSize;
                COM.TTPagination.PageNo    = Convert.ToInt64(skip);
                lstEntity = objBAL.GetAll(search.ToString().Replace("\0", string.Empty));
                COM.ExtendedMethods.SortList(lstEntity, sortColumn, sortColumnDir);
            }
            catch (Exception ex)
            { GlobalVarible.AddError(ex.Message); }

            return(Json(new
            {
                draw = draw,
                recordsTotal = lstEntity.Count(),
                recordsFiltered = COM.TTPagination.RecordCount,
                data = lstEntity
            }, JsonRequestBehavior.AllowGet));
        }
 public JsonResult SaveEntry(ENT.SMSMaster model, string smsid)
 {
     try
     {
         if (model.EntryMode == COM.Enumration.EntryMode.ADD)
         {
             model.Status = COM.MyEnumration.MyStatus.Active;
             if (objBAL.Insert(model))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
         else
         {
             model.UpdatedDateTime = DateTime.Now;
             model.UpdatedBy       = Guid.Parse(User.Identity.GetUserId());
             model.smsid           = new Guid(smsid.Replace("/", ""));
             if (objBAL.UpdatePartial(model))
             {
                 GlobalVarible.AddMessage("Record Update Successfully");
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
 //Save Entry
 public JsonResult SaveEntry(ENT.UserAndPlantMappingSUB model, string[] listMultiPlant)
 {
     try
     {
         List <Guid> dctDuplication = new List <Guid>();
         objBAL.DeleteByUserID(model.AspNetUserID);
         foreach (string el in listMultiPlant)
         {
             model.PlantId = Guid.Parse(el);
             if (model.EntryMode == COM.MyEnumration.EntryMode.ADD)
             {
                 if (objBAL.Insert(model))
                 {
                     GlobalVarible.AddMessage("Record Save Successfully");
                 }
             }
             else
             {
                 model.CreatedDateTime       = DateTime.Now;
                 model.UserAndPlantMappingID = new Guid(el.Replace("/", ""));
                 if (objBAL.Update(model))
                 {
                     GlobalVarible.AddMessage("Record Update Successfully");
                 }
             }
         }
     }
     catch (Exception ex)
     { GlobalVarible.AddError(ex.Message); }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
Exemple #11
0
        public JsonResult UpdateComplain(ENT.Complain model)
        {
            try
            {
                using (BAL.Complain objBAL = new BAL.Complain())
                {
                    objBAL.Entity.UpdatedBy       = _LoginUserId;
                    objBAL.Entity.UpdatedDateTime = DateTime.Now;
                    objBAL.Entity.complainid      = model.complainid;
                    objBAL.Entity.complainstatus  = (int)COM.MyEnumration.TICKETSTATUS.RESOLVED;
                    objBAL.Entity.adminremarks    = model.adminremarks;

                    if (objBAL.UpdateStatus(objBAL.Entity))
                    {
                        GlobalVarible.AddMessage("Complain updated successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError("Unable to update complain.Please try again.");
                    }
                }
            }
            catch (Exception ex)
            {
                ERRORREPORTING.Report(ex, _REQUESTURL, _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(model));
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
Exemple #12
0
        public JsonResult SaveComplain(ENT.Complain model)
        {
            try
            {
                using (BAL.Complain objBAL = new BAL.Complain())
                {
                    model.CreatedDateTime = DateTime.Now;
                    model.CreatedBy       = _LoginUserId;
                    model.complainstatus  = (int)COM.MyEnumration.TICKETSTATUS.CREATED;
                    model.adminremarks    = string.Empty;

                    if (objBAL.Insert(model))
                    {
                        GlobalVarible.AddMessage("Complain registered successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError("Unable to register complain.Please contact your administrator.");
                    }
                }
            }
            catch (Exception ex)
            {
                ERRORREPORTING.Report(ex, _REQUESTURL, _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(model));
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
        public JsonResult UpdateStatus(string transid, int status, string accountid)
        {
            GlobalVarible.Clear();
            try
            {
                COM.MEMBERS.SQLReturnMessageNValue mUpdate = new BAL.Recharge().UpdateRecharge(
                    accountid,
                    !string.IsNullOrEmpty(transid) ? transid : "N/A",
                    status,
                    "Manually by : " + User.Identity.GetUserName());

                if (mUpdate.Outval > 0)
                {
                    GlobalVarible.AddMessage(mUpdate.Outmsg);
                }
                else
                {
                    GlobalVarible.AddError(mUpdate.Outmsg);
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, Request.Url.ToString(), _LoginUserId, _ERRORKEY, (transid + "|" + status + "|" + accountid));
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
Exemple #14
0
        public HttpResponseMessage GetDownlineUsers()
        {
            GlobalVarible.Clear();

            List <ENT.UserProfileApiView> downlinelist = new List <ENT.UserProfileApiView>();

            try
            {
                if (User.IsInRole("masterdistributor"))
                {
                    downlinelist = new BAL.UserProfile().GetMasterDownline(_LOGINUSERID);
                }
                else if (User.IsInRole("distributor"))
                {
                    downlinelist = new BAL.UserProfile().GetDistributorDownline(_LOGINUSERID);
                }

                GlobalVarible.AddMessage("Downline users get successfully.");

                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, downlinelist }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }
Exemple #15
0
 public JsonResult SaveEntry(ENT.Routing model, string routeid)
 {
     try
     {
         List <Guid> dctDuplication = new List <Guid>();
         if (model.EntryMode == COM.Enumration.EntryMode.ADD)
         {
             model.Status = COM.MyEnumration.MyStatus.Active;
             List <ENT.Routing> lstResult = new BAL.Routing().CheckDuplicateCombination(dctDuplication, model.routetitle, "none");
             if (lstResult.Count > 0)
             {
                 throw new Exception("Route Title Already Exists.");
             }
             if (objBAL.Insert(model))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
         else
         {
             model.UpdatedDateTime = DateTime.Now;
             model.routeid         = new Guid(routeid.Replace("/", ""));
             if (objBAL.Update(model))
             {
                 GlobalVarible.AddMessage("Record Update Successfully");
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
        public JsonResult CheckTwofactor(string id, Boolean flag)
        {
            Boolean myflag = CheckTwofactorEnabled(id, flag);

            GlobalVarible.AddMessage("Two factor Enabled Update Successfully.");
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
 public JsonResult GetIsEnabled()
 {
     GlobalVarible.Clear();
     ENT.IsEnabledApiCall model = new ENT.IsEnabledApiCall();
     using (BAL.IsEnabledApiCall obj = new BAL.IsEnabledApiCall())
     {
         model = (ENT.IsEnabledApiCall)obj.GetIsEnabled(Guid.Parse(User.Identity.GetUserId()));
     }
     return(Json(model, JsonRequestBehavior.AllowGet));
 }
        public JsonResult SaveEntry(string backimage, string frontimage, int dd_type)
        {
            ENT.DMT_Documents model = new ENT.DMT_Documents();

            try
            {
                if (String.IsNullOrEmpty(frontimage))
                {
                    GlobalVarible.AddError("Please select Front Image.");
                    return(Json(MySession.Current.MessageResult));
                }
                else
                {
                    model.dd_page1 = SaveDmtDocument(frontimage);
                }

                if (String.IsNullOrEmpty(backimage))
                {
                    model.dd_page2 = string.Empty;
                }
                else
                {
                    model.dd_page2 = SaveDmtDocument(backimage);
                }

                model.dd_status       = (int)COM.MyEnumration.DMTDOCUMENTSTATUS.PENDING;
                model.dd_remarks      = string.Empty;
                model.CreatedDateTime = DateTime.Now;
                model.CreatedBy       = _LoginUserId;
                model.dd_userid       = _LoginUserId;
                model.dd_type         = dd_type;

                using (BAL.DMT_Documents objBAL = new BAL.DMT_Documents())
                {
                    if (objBAL.Insert(model))
                    {
                        GlobalVarible.AddMessage("User document saved successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError("Unable to save user document");
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }

            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
        public JsonResult DeleteBeneficary(Guid benificaryid)
        {
            registerresponse rr = new registerresponse();

            try
            {
                using (BAL.DMT_BeneficiaryRegister objBAL = new BAL.DMT_BeneficiaryRegister())
                {
                    ENT.DMT_BeneficiaryRegisterAdminView BR = objBAL.GetBenificarybyId(benificaryid);

                    if (BR != null)
                    {
                        DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                        GENERALRESPONSE GR = new GENERALRESPONSE();

                        object postdata = new
                        {
                            CustomerMobile  = BR.dmt_beneficiarymobile,
                            BeneficiaryCode = BR.dmt_requestno,
                            RemitterId      = BR.dmt_remitterId
                        };

                        string response = dmt.DeleteBeneficary(postdata, "DMT_DeleteBeneficiary");

                        GR = JsonConvert.DeserializeObject <GENERALRESPONSE>(response);

                        if (GR.code == 0)
                        {
                            if (GR.message.ToString().ToUpper() == "OTC SEND SUCCESSFULLY")
                            {
                                rr.message    = GR.message.ToString().ToUpper();
                                rr.code       = 1;
                                rr.customerid = BR.dmt_beneficiaryid;
                            }
                            GlobalVarible.AddMessage("SUCCESS");
                        }
                        else
                        {
                            GlobalVarible.AddError(GR.message.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(new { MySession.Current.MessageResult, rr }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult ApproveRequest(string id)
        {
            GlobalVarible.Clear();
            try
            {
                if (id != null)
                {
                    ENT.DMT_Documents Entity = new ENT.DMT_Documents();

                    using (BAL.DMT_Documents objBAL = new BAL.DMT_Documents())
                    {
                        objBAL.Entity.dd_id = Guid.Parse(id);
                        Entity = (ENT.DMT_Documents)objBAL.GetByPrimaryKey(objBAL.Entity);

                        objBAL.Entity.dd_status       = (int)COM.MyEnumration.DMTDOCUMENTSTATUS.APPROVED;
                        objBAL.Entity.UpdatedBy       = _LoginUserId;
                        objBAL.Entity.UpdatedDateTime = DateTime.Now;

                        if (objBAL.UpdateApprove(objBAL.Entity))
                        {
                            using (BAL.DMT_Approval dMT_Approval = new BAL.DMT_Approval())
                            {
                                dMT_Approval.Entity.approval_userid = Entity.dd_userid;
                                dMT_Approval.Entity.approval_status = (int)COM.MyEnumration.DMTAPPROVALSTATUS.APPROVED;
                                dMT_Approval.Entity.CreatedBy       = _LoginUserId;
                                dMT_Approval.Entity.CreatedDateTime = DateTime.Now;
                                if (dMT_Approval.Insert(dMT_Approval.Entity))
                                {
                                    GlobalVarible.AddMessage("Request Approved Successfully.");
                                }
                            }
                            GlobalVarible.AddMessage("Request Approved Successfully.");
                        }
                        else
                        {
                            GlobalVarible.AddMessage("Unable to Approve Request.");
                        }
                    }
                }
                else
                {
                    GlobalVarible.AddMessage("Unable Approve Request.");
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
        public JsonResult SaveAll(String[] hfoperatorcode, String[] md, String[] sd, String[] r, String[] charge, Guid rechargeslabid2)
        {
            GlobalVarible.Clear();
            try
            {
                if (hfoperatorcode == null || md == null || sd == null || r == null || charge == null)
                {
                    GlobalVarible.AddError("please add pricing details!");
                    return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
                }
                if (hfoperatorcode.Length > 0)
                {
                    bool outval = new BAL.SlabCommission().DeleteByID(rechargeslabid2);

                    List <ENT.SlabCommission> priceList = new List <ENT.SlabCommission>();
                    for (int sc = 0; sc < hfoperatorcode.Length; sc++)
                    {
                        if ((md[sc].ToString() != "0") || (sd[sc].ToString() != "0") || (r[sc].ToString() != "0") || (charge[sc].ToString() != "0"))
                        {
                            ENT.SlabCommission pdmodel = new Web.Framework.Entity.SlabCommission();
                            pdmodel.rechargeslabid  = Guid.NewGuid();
                            pdmodel.CreatedDateTime = DateTime.Now;
                            pdmodel.CreatedBy       = Guid.Parse(User.Identity.GetUserId());
                            pdmodel.slabid          = rechargeslabid2;
                            pdmodel.operatorcode    = int.Parse(hfoperatorcode[sc]);
                            pdmodel.md     = decimal.Parse(md[sc]);
                            pdmodel.sd     = decimal.Parse(sd[sc]);
                            pdmodel.r      = decimal.Parse(r[sc]);
                            pdmodel.charge = decimal.Parse(charge[sc]);
                            priceList.Add(pdmodel);
                        }
                    }
                    using (BAL.SlabCommission objPrice = new BAL.SlabCommission())
                    {
                        int Val = objPrice.BulkInsert(priceList);
                        if (Val > 0)
                        {
                            GlobalVarible.AddMessage("Record Save Successfully.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
        public JsonResult DeleteBeneficiaryConfirm(customerverificationmodel model)
        {
            GlobalVarible.Clear();
            try
            {
                DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE();

                // get customer information by id
                using (BAL.DMT_BeneficiaryRegister objBAL = new BAL.DMT_BeneficiaryRegister())
                {
                    ENT.DMT_BeneficiaryRegisterAdminView BR = objBAL.GetBenificarybyId(model.dmt_customerid);

                    //ENT.DMT_BeneficiaryRegisterAdminView BR = objBAL.GetBenificarybyId(Guid.Parse("1E2C4B19-1229-4ECE-9C04-464AA8907ADC"));

                    var postdata = new
                    {
                        BeneficiaryCode = BR.dmt_requestno,
                        RemitterId      = BR.dmt_remitterId,
                        OTP             = model.verificationotp,
                        CustomerMobile  = BR.dmt_requestno
                    };

                    string response = dmt.ValidateCustomerOTP(postdata, "DMT_DeleteBeneficiaryConfirm");

                    OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response);

                    if (OV.code == 0)
                    {
                        objBAL.Entity.dmt_beneficiaryid = model.dmt_customerid;

                        objBAL.Delete(objBAL.Entity);

                        GlobalVarible.AddMessage("Beneficiary Deleted Successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError(OV.message.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
Exemple #23
0
        public HttpResponseMessage VerifyCustomer(customerverificationmodel model)
        {
            GlobalVarible.Clear();
            try
            {
                DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE();

                // get customer information by id
                using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister())
                {
                    objBAL.Entity.dmt_customerid = model.dmt_customerid;
                    ENT.DMT_CustomerRegister customerRegister = (ENT.DMT_CustomerRegister)objBAL.GetByPrimaryKey(objBAL.Entity);

                    var postdata = new
                    {
                        RemitterId     = customerRegister.dmt_requestno,
                        OTP            = model.verificationotp,
                        CustomerMobile = customerRegister.dmt_mobile
                    };

                    string response = dmt.ValidateCustomerOTP(postdata, "DMT_OTP_Customer_Confirmation");

                    OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response);

                    if (OV.code == 0)
                    {
                        objBAL.Entity.dmt_status = 1;
                        objBAL.UpdateStatus(objBAL.Entity);

                        GlobalVarible.AddMessage("Customer Verified Successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError(OV.message.ToString());
                    }
                }
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }
Exemple #24
0
        public JsonResult VerifyCustomer(customerverificationmodel model)
        {
            GlobalVarible.Clear();
            try
            {
                DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE();

                // get customer information by id
                using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister())
                {
                    objBAL.Entity.dmt_customerid = model.dmt_customerid;
                    ENT.DMT_CustomerRegister customerRegister = (ENT.DMT_CustomerRegister)objBAL.GetByPrimaryKey(objBAL.Entity);

                    var postdata = new
                    {
                        RemitterId     = customerRegister.dmt_requestno,
                        OTP            = model.verificationotp,
                        CustomerMobile = customerRegister.dmt_mobile
                    };

                    string response = dmt.ValidateCustomerOTP(postdata, "DMT_OTP_Customer_Confirmation");

                    OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response);

                    if (OV.code == 0)
                    {
                        objBAL.Entity.dmt_status = 1;
                        objBAL.UpdateStatus(objBAL.Entity);

                        GlobalVarible.AddMessage("Customer Verified Successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError(OV.message.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
Exemple #25
0
        //Save Entry
        public JsonResult SaveEntry(ENT.SubDeviceMasterSUB model, string SubDeviceId)
        {
            try
            {
                List <Guid> dctDuplication = new List <Guid>();
                //if (model.DeviceId.ToString() == "00000000-0000-0000-0000-000000000000") { throw new Exception("Please Select Device Type."); }
                if (model.SubDeviceType.ToString() == "00000000-0000-0000-0000-000000000000")
                {
                    throw new Exception("Please Select Sub Device Type.");
                }

                if (model.EntryMode == COM.MyEnumration.EntryMode.ADD)
                {
                    model.Status = COM.MyEnumration.MyStatus.Active;
                    List <ENT.SubDeviceMasterSUB> lstResult = new BAL.SubDeviceMasterBAL().CheckDuplicateCombination(dctDuplication, COM.MyEnumration.MasterType.SubDeviceMaster, model.SubDeviceName);
                    if (lstResult.Count > 0)
                    {
                        throw new Exception("Device Name Already Exists.");
                    }

                    List <ENT.SubDeviceMasterSUB> lstResult2 = new BAL.SubDeviceMasterBAL().CheckDuplicateSerialNo(dctDuplication, COM.MyEnumration.MasterType.SubDeviceMaster, model.SerialNo);
                    if (lstResult2.Count > 0)
                    {
                        throw new Exception("Serial No Already Exists.!");
                    }

                    if (objBAL.Insert(model, ""))
                    {
                        GlobalVarible.AddMessage("Record Save Successfully");
                    }
                }
                else
                {
                    model.CreatedDateTime = DateTime.Now;
                    model.SubDeviceId     = new Guid(SubDeviceId.Replace("/", ""));
                    if (objBAL.Update(model))
                    {
                        GlobalVarible.AddMessage("Record Update Successfully");
                    }
                }
            }
            catch (Exception ex)
            { GlobalVarible.AddError(ex.Message); }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }
        public HttpResponseMessage SendNotification()
        {
            GlobalVarible.Clear();

            using (BAL.UserDeviceToken objUDT = new BAL.UserDeviceToken())
            {
                ENT.UserDeviceToken usertoken = objUDT.GetUserDeviceToken(Guid.Parse("5a5537fc-0411-45c1-8960-b24bbf1ea375"));

                if (usertoken != null)
                {
                    string message = "Your account is credited with with 100. : " + DateTime.Now.Ticks.ToString();
                    FCMNOTIFICATION.SendPushNotification(usertoken.udt_devicetoken, message, Guid.Parse("5a5537fc-0411-45c1-8960-b24bbf1ea375"), 1);
                }
            }

            return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
        }
Exemple #27
0
        public HttpResponseMessage LedgerReport(GetLedgerReportModal modal)
        {
            GlobalVarible.Clear();
            List <ENT.LedgerReportApiView> lstEntity = new List <ENT.LedgerReportApiView>();

            try
            {
                //Find paging info
                var start  = modal.PageStart;
                var length = modal.PageSize;

                int pageSize = length != 0 ? length : 0;
                int skip     = start != 0 ? start : 1;
                skip = (skip / pageSize) + 1;

                COM.TTPagination.isPageing = true;
                COM.TTPagination.PageSize  = pageSize;
                COM.TTPagination.PageNo    = Convert.ToInt64(skip);

                using (BAL.LedgerReport objBal = new BAL.LedgerReport())
                {
                    if (modal.ddrange == 1)
                    {
                        //if (string.IsNullOrEmpty(modal.fromdate) || string.IsNullOrEmpty(modal.todate))
                        //{
                        //    GlobalVarible.AddError("For custome date you must have to select form and to date.");
                        //    return ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult });
                        //}
                        lstEntity = objBal.GetAllSearchApi(modal.ddrange, modal.fromdate.GetDate(), modal.todate.GetDate(), modal.ddData, modal.search, User.GetUserlevel(), _LOGINUSERID);
                    }
                    else
                    {
                        lstEntity = objBal.GetAllSearchApi(modal.ddrange, DateTime.Now, DateTime.Now, modal.ddData, modal.search, User.GetUserlevel(), _LOGINUSERID);
                    }
                }

                GlobalVarible.AddMessage("Recharge report get successfully.");
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity, COM.TTPagination.RecordCount }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }
 public JsonResult SaveCommision(String[] hffrom, String[] hfto, String[] hfmd, String[] hfsd, String[] hfrd, String[] hftype, Guid up_dmtslabid)
 {
     GlobalVarible.Clear();
     try
     {
         if (hffrom == null || hfto == null || hfmd == null || hfsd == null || hfrd == null || hftype == null)
         {
             GlobalVarible.AddError("please add pricing details for all level !");
             return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
         }
         if (hffrom.Length > 0)
         {
             List <ENT.DMT_SlabCommission> priceList = new List <ENT.DMT_SlabCommission>();
             for (int sc = 0; sc < hffrom.Length; sc++)
             {
                 ENT.DMT_SlabCommission pdmodel = new Web.Framework.Entity.DMT_SlabCommission();
                 pdmodel.dmtslabcommid   = Guid.NewGuid();
                 pdmodel.CreatedDateTime = DateTime.Now;
                 pdmodel.CreatedBy       = Guid.Parse(User.Identity.GetUserId());
                 pdmodel.dmtslabid       = up_dmtslabid;
                 pdmodel.dmtfromval      = decimal.Parse(hffrom[sc]);
                 pdmodel.dmttoval        = decimal.Parse(hfto[sc]);
                 pdmodel.dmtmd           = decimal.Parse(hfmd[sc]);
                 pdmodel.dmtsd           = decimal.Parse(hfsd[sc]);
                 pdmodel.dmtrd           = decimal.Parse(hfrd[sc]);
                 pdmodel.dmttype         = int.Parse(hftype[sc]);
                 priceList.Add(pdmodel);
             }
             using (BAL.DMT_SlabCommission objPrice = new BAL.DMT_SlabCommission())
             {
                 int Val = objPrice.BulkInsert(priceList);
                 if (Val > 0)
                 {
                     GlobalVarible.AddMessage("Dmt Commission Saved Successfully.");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
Exemple #29
0
 public JsonResult UpdateEntry(ENT.UserProfile model, string up_id)
 {
     try
     {
         model.UpdatedDateTime = DateTime.Now;
         model.UpdatedBy       = Guid.Parse(User.Identity.GetUserId());
         model.up_id           = new Guid(up_id.Replace("/", ""));
         if (objBAL.UpdatePartialOther(model))
         {
             GlobalVarible.AddMessage("Record Update Successfully");
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
Exemple #30
0
 public JsonResult DeleteEntry(string id)
 {
     GlobalVarible.Clear();
     if (id != null)
     {
         Model         = new Web.Framework.Entity.Routing();
         Model.routeid = new Guid(id);
         if (objBAL.Delete(Model))
         {
             GlobalVarible.AddMessage("Record Delete Successfully.");
         }
         else
         {
             GlobalVarible.AddError("Internal Server Error Please Try Again");
         }
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }