Example #1
0
        public ActionResult PeriodicPayment2()
        {
            PeriodicPaymentModel lmd = new PeriodicPaymentModel();

            Connection.Connection con    = new Connection.Connection();
            DateTimeFormatInfo    format = new DateTimeFormatInfo();

            format.ShortDatePattern = "mm/dd/yyyy";
            if (User.Identity.GetUserId() != null)
            {
                DataSet ds = new DataSet();
                ds = con.DonatorData(User.Identity.GetUserId());
                if (ds.Tables[0].Rows.Count == 1)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    lmd.Us_Name         = dr["Us_Name"].ToString();
                    lmd.Us_LName        = dr["Us_LName"].ToString();
                    lmd.Us_Phone        = dr["Us_Phone"].ToString();
                    lmd.Us_Email        = dr["Us_Email"].ToString();
                    lmd.Us_BirthDay     = Convert.ToDateTime(dr["Us_BirthDay"], format);
                    lmd.Us_HomeAddress  = dr["Us_HomeAddress"].ToString();
                    lmd.Us_WorkAddress  = dr["Us_WorkAddress"].ToString();
                    lmd.City_Ct_Id      = Convert.ToInt16(dr["City_Ct_Id"]);
                    lmd.SelectedState   = con.StateData(lmd.City_Ct_Id);
                    lmd.SelectedCountry = con.CountryData(lmd.SelectedState);
                    lmd.Countries       = con.GetListOfCountries();
                    lmd.States          = con.GetListOfStates(lmd.SelectedCountry);
                    lmd.Cities          = con.GetListOfCities(lmd.SelectedState);
                    if (dr["Dr_Us_ID"].ToString() != "")
                    {
                        lmd.Dr_AccTransaction  = Convert.ToBoolean(dr["Dr_AccTransaction"]);
                        lmd.Dr_Amount          = Convert.ToInt32(dr["Dr_Amount"]);
                        lmd.Dr_CardTranscation = Convert.ToBoolean(dr["Dr_CardTranscation"]);
                        lmd.Dr_Cleaner         = Convert.ToBoolean(dr["Dr_Cleaner"]);
                        lmd.Dr_Clothes         = Convert.ToBoolean(dr["Dr_Clothes"]);
                        lmd.Dr_CT_Code         = Convert.ToByte(dr["Dr_CT_Code"]);
                        lmd.Dr_Endowment       = Convert.ToBoolean(dr["Dr_Endowment"]);
                        lmd.Dr_Food            = Convert.ToBoolean(dr["Dr_Food"]);
                        lmd.Dr_HelpDay         = Convert.ToByte(dr["Dr_HelpDay"]);
                        lmd.Dr_Inperson        = Convert.ToBoolean(dr["Dr_Inperson"]);
                        lmd.Dr_Medical         = Convert.ToBoolean(dr["Dr_Medical"]);
                        lmd.Dr_Month_Duration  = Convert.ToByte(dr["Dr_Month_Duration"]);
                        lmd.Dr_Representative  = Convert.ToBoolean(dr["Dr_Representative"]);
                        lmd.Dr_Stationery      = Convert.ToBoolean(dr["Dr_Stationery"]);
                    }
                    return(View(lmd));
                }
            }
            lmd.Us_BirthDay = Convert.ToDateTime(DateTime.Now, format);
            lmd.Countries   = con.GetListOfCountries();
            lmd.States      = con.GetListOfStates(1);
            lmd.Cities      = con.GetListOfCities(1);
            //lmd.City_Ct_Id-=Convert.ToInt16(lmd.Cities[0].value;
            return(View(lmd));
        }
        //
        // GET: /Manage/SetPassword
        public ActionResult ChangePersonalInformation()
        {
            ChangePersonalInformation lmd = new ChangePersonalInformation();
            DataSet ds = new DataSet();

            Connection.Connection con = new Connection.Connection();
            ds = con.UserData(User.Identity.GetUserId());
            if (ds.Tables[0].Rows.Count == 1)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                lmd.Us_Name  = dr["Us_Name"].ToString();
                lmd.Us_LName = dr["Us_LName"].ToString();
                lmd.Us_Phone = dr["Us_Phone"].ToString();

                DateTimeFormatInfo format = new DateTimeFormatInfo();
                format.ShortDatePattern = "mm/dd/yyyy";
                lmd.Us_BirthDay         = Convert.ToDateTime(dr["Us_BirthDay"], format);

                lmd.Us_HomeAddress  = dr["Us_HomeAddress"].ToString();
                lmd.Us_WorkAddress  = dr["Us_WorkAddress"].ToString();
                lmd.City_Ct_Id      = Convert.ToInt16(dr["City_Ct_Id"]);
                lmd.SelectedState   = con.StateData(lmd.City_Ct_Id);
                lmd.SelectedCountry = con.CountryData(lmd.SelectedState);
                lmd.Countries       = con.GetListOfCountries();
                lmd.States          = con.GetListOfStates(lmd.SelectedCountry);
                lmd.Cities          = con.GetListOfCities(lmd.SelectedState);
            }
            return(View(lmd));
        }
Example #3
0
        public ActionResult OnlinePayment(OnlinePaymentModel model)
        {
            bool TheError = false;

            if (ModelState.IsValid)
            {
                Connection.Connection con = new Connection.Connection();
                if (User.Identity.GetUserId() == null)
                {
                    TheError = con.AddUserAndPayment(model);
                }
                else
                {
                    TheError = con.UpdateUserAndPayment(model, User.Identity.GetUserId());
                }
            }
            if (TheError == false)
            {
                ViewBag.Message = "";
                return(RedirectToAction("OnlinePayment2", "Home", model));
            }
            else
            {
                ViewBag.Message = "خطا در ثبت اطلاعات";
                Connection.Connection con = new Connection.Connection();
                model.Countries = con.GetListOfCountries();
                model.States    = con.GetListOfStates(model.SelectedCountry);
                model.Cities    = con.GetListOfCities(model.SelectedState);
                return(View(model));
            }
        }
Example #4
0
        public ActionResult OnlinePayment()
        {
            OnlinePaymentModel lmd = new OnlinePaymentModel();

            Connection.Connection con    = new Connection.Connection();
            DateTimeFormatInfo    format = new DateTimeFormatInfo();

            //format.ShortDatePattern = "mm-dd-yyyy";
            format.ShortDatePattern = "mm/dd/yyyy";
            if (User.Identity.GetUserId() != null)
            {
                DataSet ds = new DataSet();
                ds          = con.UserData(User.Identity.GetUserId());
                lmd.Do_Date = Convert.ToDateTime(DateTime.Now, format);
                if (ds.Tables[0].Rows.Count == 1)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    lmd.Us_Name         = dr["Us_Name"].ToString();
                    lmd.Us_LName        = dr["Us_LName"].ToString();
                    lmd.Us_Phone        = dr["Us_Phone"].ToString();
                    lmd.Us_Email        = dr["Us_Email"].ToString();
                    lmd.Us_HomeAddress  = dr["Us_HomeAddress"].ToString();
                    lmd.Us_WorkAddress  = dr["Us_WorkAddress"].ToString();
                    lmd.City_Ct_Id      = Convert.ToInt16(dr["City_Ct_Id"]);
                    lmd.SelectedState   = con.StateData(lmd.City_Ct_Id);
                    lmd.SelectedCountry = con.CountryData(lmd.SelectedState);
                    lmd.Countries       = con.GetListOfCountries();
                    lmd.States          = con.GetListOfStates(lmd.SelectedCountry);
                    lmd.Cities          = con.GetListOfCities(lmd.SelectedState);

                    return(View(lmd));
                }
            }
            //lmd.Us_BirthDay = Convert.ToDateTime(DateTime.Now, format);
            lmd.SelectedState   = 1;
            lmd.SelectedCountry = 1;
            lmd.City_Ct_Id      = 1;
            lmd.Countries       = con.GetListOfCountries();
            lmd.States          = con.GetListOfStates(1);
            lmd.Cities          = con.GetListOfCities(1);
            return(View(lmd));
        }
Example #5
0
        public ActionResult PatientList(Int16 SeletedSupporter, Int16 SeletedSeyed)
        {
            PatientListModel lmd = new PatientListModel();
            DataSet          ds  = new DataSet();

            Connection.Connection con = new Connection.Connection();
            ds                   = con.PatientData(SeletedSupporter, SeletedSeyed);
            lmd.Countries        = con.GetListOfCountries();
            lmd.SeletedSupporter = SeletedSupporter;
            lmd.SeletedSeyed     = SeletedSeyed;

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                PatientModel Tmp = new PatientModel();
                Tmp.Pt_Ct_Code      = Convert.ToInt16(dr["Pt_Ct_Code"]);
                Tmp.SelectedState   = con.StateData(Tmp.Pt_Ct_Code);
                Tmp.SelectedCountry = con.CountryData(Tmp.SelectedState);

                lmd.Patients.Add(new PatientModel
                {
                    Pt_Id = Convert.ToInt32(dr["Pt_Id"]),
                    //Pt_Name = dr["Pt_Name"].ToString(),
                    //Pt_LName = dr["Pt_LName"].ToString(),
                    Pt_Ct_Code      = Tmp.Pt_Ct_Code,
                    Pt_Seyyed       = Convert.ToInt16(dr["Pt_Seyyed"]),
                    Pt_Supporter    = Convert.ToInt16(dr["Pt_Supporter"]),
                    Pt_BirthDay     = Convert.ToDateTime(dr["Pt_BirthDay"]),
                    Pt_Sickness     = dr["Pt_Sickness"].ToString(),
                    Pt_Sex          = Convert.ToInt16(dr["Pt_Sex"]),
                    Pt_Tel          = dr["Pt_Tel"].ToString(),
                    Pt_Address      = dr["Pt_Address"].ToString(),
                    SelectedState   = con.StateData(Tmp.Pt_Ct_Code),
                    SelectedCountry = con.CountryData(Tmp.SelectedState),
                    States          = con.GetListOfStates(Tmp.SelectedCountry),
                    Cities          = con.GetListOfCities(Tmp.SelectedState),
                    Pt_Photo_Path   = dr["Pt_Photo_Path"].ToString(),
                    Pt_CompleteName = dr["Pt_Name"].ToString() + ' ' + dr["Pt_LName"].ToString()
                });
            }
            return(View(lmd));
        }