Esempio n. 1
0
 public object GetSingleSmsSettingData(ParamSmsSetting objPS)
 {
     try
     {
         var SmsData = objGR.tbl_smsconfiguration.Where(r => r.SETTINGID == objPS.SettingId).First();
         if (SmsData == null)
         {
             return(new Error()
             {
                 IsError = true, Message = "No records Found."
             });
         }
         else
         {
             // return new Result() { IsSucess = true, ResultData = SmsData };
             return(SmsData);
         }
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
Esempio n. 2
0
        public object SaveSmsSetting(ParamSmsSetting PS)
        {
            try
            {
                tbl_smsconfiguration objTBL = new tbl_smsconfiguration();
                objTBL.GATEWAYUSERID   = PS.GatewayUserid;
                objTBL.GATEWAYPASSWORD = PS.GatewayPassword;
                objTBL.SMSSENDAPI      = PS.SmsSendApi;
                objTBL.CHECKBALANCEAPI = PS.CheckbalanceApi;
                objTBL.DISPLAY         = 1;
                objTBL.created_date    = DateTime.Now;

                objGR.tbl_smsconfiguration.Add(objTBL);
                objGR.SaveChanges();
                return(new Result()
                {
                    IsSucess = true, ResultData = "Sms Settings Saved Succesfully!!"
                });
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
Esempio n. 3
0
        public object DeleteSmsSetting(ParamSmsSetting objPS)

        {
            try
            {
                tbl_smsconfiguration objTBL = objGR.tbl_smsconfiguration.Where(r => r.SETTINGID == objPS.SettingId).First();

                if (objTBL.DISPLAY == 1)
                {
                    objTBL.DISPLAY = 0;
                }
                else
                {
                    objTBL.DISPLAY = 1;
                }

                objGR.SaveChanges();
                return(new Result()
                {
                    IsSucess = true, ResultData = "Sms Settings Deleted Successfully."
                });
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
 public object DeleteSmsInformation([FromBody] ParamSmsSetting objsms)
 {
     try
     {
         GetSmsSettingData objSMS = new GetSmsSettingData();
         var result = objSMS.DeleteSmsSetting(objsms);
         return(result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
 public object UpdateSmsSettings([FromBody] ParamSmsSetting objPS)
 {
     try
     {
         GetSmsSettingData objSMS = new GetSmsSettingData();
         var result = objSMS.UpdateSmsSetting(objPS);
         return(result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
 public object GetSingleSmsSetting([FromBody] ParamSmsSetting objPS)
 {
     try
     {
         GetSmsSettingData objSMS = new GetSmsSettingData();
         var SingleData           = objSMS.GetSingleSmsSettingData(objPS);
         return(SingleData);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
 public object SaveSmsSettings([FromBody] ParamSmsSetting objSMS)
 {
     try
     {
         GetSmsSettingData obj = new GetSmsSettingData();
         var SmsSetting        = obj.SaveSmsSetting(objSMS);
         return(SmsSetting);
     }
     catch (Exception ex)
     {
         return(new Error()
         {
             IsError = true, Message = ex.Message
         });
     }
 }
 public object SmsSettingList([FromBody] ParamSmsSetting obj)
 {
     try
     {
         GetSmsSettingData objSMS = new GetSmsSettingData();
         var status  = obj.DisplayStatus;
         var SmsData = objSMS.GetSmsSettingsDataBL(status);
         return(SmsData);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
Esempio n. 9
0
 public object UpdateSmsSetting(ParamSmsSetting objPS)
 {
     try
     {
         tbl_smsconfiguration objTBL = objGR.tbl_smsconfiguration.Where(r => r.SETTINGID == objPS.SettingId).First();
         objTBL.GATEWAYUSERID   = objPS.GatewayUserid;
         objTBL.GATEWAYPASSWORD = objPS.GatewayPassword;
         objTBL.SMSSENDAPI      = objPS.SmsSendApi;
         objTBL.CHECKBALANCEAPI = objTBL.CHECKBALANCEAPI;
         objTBL.modified_date   = DateTime.Now;
         objGR.SaveChanges();
         return(new Result()
         {
             IsSucess = true, ResultData = "Sms Settings Updated Successfully."
         });
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }