Пример #1
0
        public ResCommon DeleteUserHsn(ReqUserHsn reqUserHsn)
        {
            ResCommon resCommon = new ResCommon();

            return(DBCall.DeleteUserHsn(reqUserHsn, ExtensionMethods.GetStoreProcHsnOrHsv(reqUserHsn.HsnOrHsc, StaticConst.SPDELETEUSERHSNCODE, StaticConst.SPDELETEUSERHSCCODE)));
            //return Common<ReqUserHsn, ResCommon>.Serialize_Deserialize(reqUserHsn, resCommon, ExtensionMethods.GetStoreProcHsnOrHsv(reqUserHsn.HsnOrHsc, StaticConst.SPDELETEUSERHSNCODE, StaticConst.SPDELETEUSERHSCCODE));
        }
Пример #2
0
        public static ResCommon SendMailCustom(ReqEmail reqEmail, string Password = null)
        {
            ResCommon resCommon = new ResCommon();

            try
            {
                EASendMail.SmtpMail   oMail = new SmtpMail("TryIt");
                EASendMail.SmtpClient oSmtp = new EASendMail.SmtpClient();

                // Set sender email address, please change it to yours
                oMail.From = StaticConst.EMAILID;

                // Set recipient email address, please change it to yours
                oMail.To   = reqEmail.EmailId;
                oMail.From = new EASendMail.MailAddress(reqEmail.UserName, StaticConst.EMAILID);

                // Set email subject
                oMail.Subject = reqEmail.EmailSubject;

                string       path      = AppDomain.CurrentDomain.BaseDirectory + "\\Optimize\\EmailHtml\\";
                StreamReader strReader = new StreamReader(path + reqEmail.HtmlType + ".html");
                string       objReader = strReader.ReadToEnd();
                objReader = objReader.Replace("{{Username}}", reqEmail.UserName);
                objReader = objReader.Replace("{{EmailBody}}", reqEmail.EmailBody);

                if (reqEmail.HtmlType.Contains("Password"))
                {
                    objReader.Replace("{{ Password}}", Password);
                }
                oMail.HtmlBody = objReader;
                if (!String.IsNullOrEmpty(reqEmail.EmailAttachmentUrl))
                {
                    oMail.AddAttachment(reqEmail.EmailAttachmentUrl);
                }
                // Your SMTP server address
                SmtpServer oServer = new SmtpServer(StaticConst.SERVERNAME);

                // User and password for ESMTP authentication, if your server doesn't require
                // User authentication, please remove the following codes.

                oServer.User = StaticConst.EMAILID;

                oServer.Password = StaticConst.EMAILPASSWORD;
                oSmtp.SendMail(oServer, oMail);
                resCommon.ResponseCode    = 0;
                resCommon.ResponseMessage = "Email Sent Successfully";

                return(resCommon);
            }
            catch (Exception ex)
            {
                resCommon.ResponseCode    = 1;
                resCommon.ResponseMessage = "Error while sending Email";
                return(resCommon);
            }
        }
Пример #3
0
        public static ResCommon InsertBrsPayment(ReqBrsPaymentList reqBrsPayment, string spName)
        {
            ResCommon resCommon = new ResCommon();

            DataTable dt = new DataTable();

            try
            {
                using (SqlConnection con = new SqlConnection(StaticConst.connectionString))
                {
                    using (SqlCommand cmd = new SqlCommand(spName, con))
                    {
                        string    json                = JsonConvert.SerializeObject(reqBrsPayment);
                        JObject   jObject             = JObject.Parse(json);
                        var       jarray              = Convert.ToString(jObject["reqBrsPaymentList"]);
                        DataTable dtReqBrsPaymentList = (DataTable)JsonConvert.DeserializeObject(jarray, (typeof(DataTable)));
                        dtReqBrsPaymentList.Columns.Remove("Type");
                        dtReqBrsPaymentList.Columns.Remove("ResponseMessage");
                        dtReqBrsPaymentList.Columns.Remove("ResponseCode");

                        cmd.CommandType = System.Data.CommandType.StoredProcedure;
                        con.Open();

                        cmd.Parameters.Add(new SqlParameter("@BrsPaymentType", dtReqBrsPaymentList));
                        cmd.Parameters.Add(new SqlParameter("@Type", reqBrsPayment.Type));
                        using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                        {
                            da.Fill(dt);
                            if (dt.Rows.Count > 0)
                            {
                                resCommon.ResponseCode    = 0;
                                resCommon.ResponseMessage = reqBrsPayment.Type + " Inserted Successfully";
                            }
                            else
                            {
                                resCommon.ResponseCode    = 0;
                                resCommon.ResponseMessage = "No Records Found";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }

            return(resCommon);
        }
Пример #4
0
        public ResCommon DeleteInvoice(ReqId reqId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqId, resCommon, StaticConst.SPDELETEINVOICE));
        }
Пример #5
0
        public ResCommon DeleteEstimate(ReqId reqId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqId, resCommon, StaticConst.SPDELETEESTIMATE));
        }
Пример #6
0
        public ResCommon DeleteDebit(ReqId reqId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqId, resCommon, StaticConst.SPDELETEDEBIT));
        }
Пример #7
0
        public ResCommon DeleteAdvance(ReqId reqId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqId, resCommon, StaticConst.SPDELETEADVANCE));
        }
Пример #8
0
        public ResCommon InsertProfile(ReqProfile reqProfile)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqProfile, ResCommon> .Serialize_Deserialize(reqProfile, resCommon, StaticConst.SP_INSERTPROFILE));
        }
Пример #9
0
        public ResCommon UpdatePassword(ReqUpdatePassword reqUpdatePassword)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqUpdatePassword, ResCommon> .Serialize_Deserialize(reqUpdatePassword, resCommon, StaticConst.SP_UPDATEPASSWORD));
        }
Пример #10
0
        public ResCommon DeleteVendor(ReqId reqVendorId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqVendorId, resCommon, StaticConst.SPDELETEVENDOR));
        }
Пример #11
0
        public ResCommon UpdateVendor(ReqVendorUpdate reqVendorUpdate)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqVendorUpdate, ResCommon> .Serialize_Deserialize(reqVendorUpdate, resCommon, StaticConst.SPUPDATEVENDOR));
        }
Пример #12
0
        public ResCommon InsertUserHSNCode(ReqInsertUserHsn reqInsertUserHsn)
        {
            ResCommon resCommon = new ResCommon();

            return(DBCall.InsertUserHSNCode(reqInsertUserHsn, ExtensionMethods.GetStoreProcHsnOrHsv(reqInsertUserHsn.HsnOrHsc, StaticConst.SPINSERTUSERHSNCODE, StaticConst.SPINSERTUSERHSCCODE)));
        }
Пример #13
0
        public ResCommon UpdateUser(ReqUpdateUser reqUpdateUser)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqUpdateUser, ResCommon> .Serialize_Deserialize(reqUpdateUser, resCommon, StaticConst.SPUPDATEUSER));
        }
Пример #14
0
        public ResCommon DeleteUser(ReqUserId reqUserId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqUserId, ResCommon> .Serialize_Deserialize(reqUserId, resCommon, StaticConst.SPDELETEUSER));
        }
Пример #15
0
        public ResCommon DeleteCustomer(ReqId reqCustomerId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqCustomerId, resCommon, StaticConst.SPDELETECUSTOMER));
        }
Пример #16
0
        public ResCommon UpdateLogo(ReqUpdateLogo reqUpdateLogo)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqUpdateLogo, ResCommon> .Serialize_Deserialize(reqUpdateLogo, resCommon, StaticConst.SPUPDATELOGO));
        }
Пример #17
0
        public ResCommon DeletePurchase(ReqId reqId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqId, resCommon, StaticConst.SPDELETEPURCHASE));
        }
Пример #18
0
        public ResCommon ValidateOtp(ReqOtpValidate reqValidateOtp)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqOtpValidate, ResCommon> .Serialize_Deserialize(reqValidateOtp, resCommon, StaticConst.SP_VALIDATEOTP));
        }
Пример #19
0
        public ResCommon DeleteBill(ReqId reqBillId)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqId, ResCommon> .Serialize_Deserialize(reqBillId, resCommon, StaticConst.SPDELETEBILL));
        }
Пример #20
0
        public ResCommon UpdateProfile(ReqProfile reqProfile)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqProfile, ResCommon> .Serialize_Deserialize(reqProfile, resCommon, StaticConst.SP_UPDATEPROFILE));
        }
Пример #21
0
        public ResCommon InsertBillPayment(ReqBillPayment resBillPayment)
        {
            ResCommon resCommon = new ResCommon();

            return(Common <ReqBillPayment, ResCommon> .Serialize_Deserialize(resBillPayment, resCommon, StaticConst.SPINSERTBILLPAYMENT));
        }