Ejemplo n.º 1
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
                });
            }
        }
Ejemplo n.º 2
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
                });
            }
        }
Ejemplo n.º 3
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
         });
     }
 }