Example #1
0
        public static Dictionary <String, String> sendForgetPasswordEmail(String email)
        {
            Dictionary <String, String> responseDic = new Dictionary <String, String>();

            String    emailSendTo = email;
            DataTable dt          = AjaxService.getUser(email);

            if (!CommonUtil.DT.isEmptyOrNull(dt))
            {
                IDictionary context = new Hashtable();
                context.Add("USER_ID", dt.Rows[0]["EMAIL"] + "");
                context.Add("PASSWORD", dt.Rows[0]["PASSWORD"] + "");
                String html = CommonUtil.readTemlate("forgetPassword.vm", context);
                EmailService.SendMail(ConfigUtil.MailFrom, emailSendTo, "Forget Password Response", html);
                responseDic.Add("info", "UserId and Password has been sent to Your e-Mail ID. \n Please Check Your e-Mail");
            }
            else
            {
                responseDic.Add("error", "Oops!! Email is not Registered.");
            }

            return(responseDic);
        }
Example #2
0
        public static Dictionary <string, string> checkInventory(DataTable dt, string sessionId)
        {
            Dictionary <string, string> invDic = new Dictionary <string, string>();

            if (CommonUtil.DT.isEmptyOrNull(dt))
            {
                dt = HomeService.getCartDT(sessionId);
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                Dictionary <string, string> dic = new Dictionary <string, string>();
                int inventory = AjaxService.getInventory(dt.Rows[i]["SKU"] + "");
                if (inventory == 0)
                {
                    invDic.Add(dt.Rows[i]["SKU"] + "", "SOLD_OUT");
                }
                else if (inventory < Int32.Parse(dt.Rows[i]["QTY"] + ""))
                {
                    string msg = "Only " + inventory + " Item(s) are left in inventory!!";
                    invDic.Add(dt.Rows[i]["SKU"] + "", msg);
                }
            }
            return(invDic);
        }