public int Register(string n, string sex, string sid, DateTime dateTime, string p)
        {
            if (n == "")
            {
                return(-1);
            }
            if (sid == "")
            {
                return(-2);
            }
            if (p == "")
            {
                return(-3);
            }
            int flag = new RegisterDAL().RegisterOK(n, sex, sid, dateTime, p);

            if (flag == 0)
            {
                return(0);
            }
            if (flag == 666)
            {
                return(1);
            }
            else
            {
                return(2);
            }
        }
示例#2
0
        // 註冊新分銷商
        public void Register(RegisterModel reg)
        {
            try
            {
                if (reg.PASSWORD != null)
                {
                    reg.PASSWORD  = Sha256Helper.Gethash(reg.PASSWORD);
                    reg.USER_UUID = Guid.NewGuid().ToString();

                    string[] time = reg.TIMEZONE.Split(new char[2] {
                        ',', ':'
                    });
                    reg.TIMEZONE = time[1];

                    string[] country = reg.COUNTRY_CODE.Split(new char[1] {
                        ','
                    });
                    reg.COUNTRY_CODE = country[0];
                    reg.TEL_CODE     = country[1];

                    RegisterDAL.InsCompany(reg);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
        public UnifyApiResult FindPageList(string statusType, string rtype, int currentPageIndex, int pageSize)
        {
            RegisterDAL           dal    = new RegisterDAL();
            IEnumerable <dynamic> result = dal.FindPageList(statusType, rtype, currentPageIndex, pageSize, out var total);
            var enumerable = result as dynamic[] ?? result.ToArray();

            return(UnifyApiResult.PageResult(enumerable, total));
        }
示例#4
0
        public UnifyApiResult Remove(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(UnifyApiResult.Error("编号不能为空。"));
            }

            RegisterDAL dal    = new RegisterDAL();
            dynamic     result = dal.Remove(id);

            return(UnifyApiResult.Sucess(result));
        }
示例#5
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        objBEL       = new TeacherBEL();
        objDAL       = new RegisterDAL();
        objBEL.fname = TextBox1.Text;
        objBEL.mname = mtextbox.Text;
        objBEL.lname = TextBox2.Text;


        if (RadioButton1.Checked)
        {
            objBEL.gender = "male";
        }
        else
        {
            objBEL.gender = "female";
        }
        objBEL.cno   = TextBox3.Text;
        objBEL.email = TextBox4.Text;
        objBEL.bgrp  = DropDownList1.SelectedValue;

        objBEL.dob     = TextBox18.Text;
        objBEL.gbranch = DropDownList8.SelectedValue;;
        Byte[] imgByte = null;
        if (FileUpload1.HasFile && FileUpload1.PostedFile != null)
        {
            HttpPostedFile File = FileUpload1.PostedFile;
            imgByte = new Byte[File.ContentLength];
            File.InputStream.Read(imgByte, 0, File.ContentLength);
        }
        objBEL.img   = imgByte;
        objBEL.gyear = DropDownList9.SelectedValue;
        objBEL.gclg  = TextBox7.Text;
        objBEL.psub  = TextBox9.Text;
        objBEL.pyear = DropDownList10.SelectedValue;
        objBEL.pclg  = TextBox17.Text;
        objBEL.aoi   = TextBox11.Text;
        objBEL.exp   = DropDownList2.SelectedValue;
        objBEL.doj   = TextBox14.Text;
        objBEL.desig = DropDownList4.SelectedValue;

        objBEL.mstatus = DropDownList11.SelectedValue;



        objBEL.uname = TextBox12.Text;
        objBEL.pass  = TextBox13.Text;
        objBEL.photo = TextBox1.Text;
        objBEL.add   = TextBox8.Text;
        Label2.Text  = objDAL.AddTeacher(objBEL);
        Response.Redirect("Login.aspx");
    }
示例#6
0
        public static int GetAcc(AccNum accNum)
        {
            int r = RegisterDAL.CustomerRegister(accNum);

            if (r == 1)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
示例#7
0
        public static void RegisterComponents(IServiceCollection services)
        {
            services.AddHttpClient();
            services.AddSingleton <RequestToHttpHelper>();
            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            RegisterBLL.RegisterComponents(services);
            RegisterDAL.RegisterComponents(services);
            RegisterMediatR.RegisterComponents(services);

            //自动注入IAutoInject
            services.Scan(x =>
            {
                var entryAssembly        = Assembly.GetEntryAssembly();
                var referencedAssemblies = entryAssembly.GetReferencedAssemblies().Select(Assembly.Load);
                var assemblies           = new List <Assembly> {
                    entryAssembly
                }.Concat(referencedAssemblies);

                x.FromAssemblies(assemblies)
                .AddClasses(classes => classes.AssignableTo(typeof(IAutoInject)))
                .AsImplementedInterfaces()
                .WithScopedLifetime()
                //接口注册Scoped
                .AddClasses(classes => classes.AssignableTo(typeof(IScopedAutoInject)))
                .AsImplementedInterfaces()
                .WithScopedLifetime()
                //接口注册Singleton
                .AddClasses(classes => classes.AssignableTo(typeof(ISingletonAutoInject)))
                .AsImplementedInterfaces()
                .WithSingletonLifetime()
                //接口注册Transient
                .AddClasses(classes => classes.AssignableTo(typeof(ITransientAutoInject)))
                .AsImplementedInterfaces()
                .WithTransientLifetime()
                //具体类注册Scoped
                .AddClasses(classes => classes.AssignableTo(typeof(ISelfScopedAutoInject)))
                .AsSelf()
                .WithScopedLifetime()
                //具体类注册Singleton
                .AddClasses(classes => classes.AssignableTo(typeof(ISelfSingletonAutoInject)))
                .AsSelf()
                .WithSingletonLifetime()
                //具体类注册Transient
                .AddClasses(classes => classes.AssignableTo(typeof(ISelfTransientAutoInject)))
                .AsSelf()
                .WithTransientLifetime();
            });
        }
        protected void lnkbtnSave_OnClick(object sender, EventArgs e)
        {
            if (chkTermsCondi.Checked)
            {
                lnkbtnOTPSend.Visible = false;
                txtMobileOtp.Text     = "";
                RegisterDAL obj = new RegisterDAL();
                if (obj.IsExists(txtemailid.Text.Trim()))
                {
                    lblMainSuccessMsg.Visible = true;
                    lblMainSuccessMsg.Text    = "User Email id already exists, Please select another Email id";
                }
                else
                {
                    Random generator = new Random();
                    Int64  OTP       = generator.Next(100000, 999999);
                    ViewState["OTP"]        = OTP;
                    lblSuccessMsg.ForeColor = System.Drawing.Color.Green;
                    string Message = "Dear Customer,Your One Time Password is " + OTP + ".Please enter OTP to proceed.Thank you,Team COGXIM";

                    string           Subject        = "OTP Varification.";
                    string           EmailBody      = string.Empty;
                    string           OwnerName      = txtOwnerName.Text.Trim();
                    RegisterDAL      objtblRegister = new RegisterDAL();
                    tblEmailTemplate EmailTemplates = objtblRegister.SelectUserMailTemplates("OTP");
                    EmailBody = EmailTemplates.Body.ToString();
                    EmailBody = EmailBody.Replace("$$UserName$$", OwnerName);
                    EmailBody = EmailBody.Replace("$$OTP$$", ViewState["OTP"].ToString());

                    if (SendMailMessage(txtemailid.Text.Trim(), "", "", Subject, EmailBody))
                    {
                        // Sending mail to user
                    }

                    if (SendMsgForOTP(txtMobileNumber.Text.Trim(), Message))
                    {
                        multivwRegstr.ActiveViewIndex = 1;
                        lblSuccessMsg.Visible         = true;
                        lblSuccessMsg.Text            = "Your OTP is send to your mobile number and Email also, Please enter OTP to proceed complete registration";
                    }
                    else
                    {
                        lblSuccessMsg.Text = "Fetal error!, Please contact to support.";
                    }
                }
            }
        }
示例#9
0
        public ActionResult Verify(Login lg)
        {
            LoginDAL lgdal = new LoginDAL();

            if (!lgdal.VerifyData(lg))
            {
                Response.Write("Login Failure");
            }
            else
            {
                var lglist = lgdal.GetLoginDetails();
                var dt     = lglist.Where(x => x.Account_No == lg.Account_No).Select(x => x.LastLogin);

                if (dt.First() == null)
                {
                    lg.LastLogin = DateTime.Now;
                    lgdal.UpdateLoginDetails(lg);
                    return(RedirectToAction("ChangePassword"));
                }
                else
                {
                    RegisterDAL   rd     = new RegisterDAL();
                    RegisterModel rm     = new RegisterModel();
                    var           rmlist = rd.PeekDetails();
                    foreach (var item in rmlist)
                    {
                        if (item.Account_No == lg.Account_No)
                        {
                            rm.Account_Name = item.Account_Name;
                            rm.Account_No   = item.Account_No;
                            rm.Address      = item.Address;
                            rm.Bank_Branch  = item.Bank_Branch;
                            rm.Email        = item.Email;
                            rm.IFSC         = item.IFSC;
                            rm.Mobile_No    = item.Mobile_No;
                            rm.Password     = item.Password;
                            Session["User"] = rm;
                            break;
                        }
                    }

                    return(RedirectToAction("Index", "Customer"));
                }
            }
            return(View());
        }
示例#10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        objBEL       = new NonTeacherBEL();
        objDAL       = new RegisterDAL();
        objBEL.fname = TextBox1.Text;
        objBEL.mname = TextBox5.Text;
        objBEL.lname = TextBox2.Text;
        if (RadioButton1.Checked)
        {
            objBEL.gender = "male";
        }
        else
        {
            objBEL.gender = "female";
        }
        objBEL.contnumber = TextBox3.Text;
        objBEL.emailid    = TextBox4.Text;
        objBEL.bloodgroup = DropDownList1.SelectedValue;
        Byte[] imgByte = null;
        if (FileUpload1.HasFile && FileUpload1.PostedFile != null)
        {
            HttpPostedFile File = FileUpload1.PostedFile;
            imgByte = new Byte[File.ContentLength];
            File.InputStream.Read(imgByte, 0, File.ContentLength);
        }
        objBEL.img = imgByte;

        objBEL.dob               = TextBox18.Text;
        objBEL.qualification     = DropDownList5.SelectedValue;
        objBEL.collegename       = TextBox6.Text;
        objBEL.addcorrespondance = TextBox8.Text;
        objBEL.peraddress        = TextBox10.Text;
        objBEL.exp               = DropDownList2.SelectedValue;
        objBEL.dojoin            = TextBox19.Text;
        objBEL.designation       = DropDownList4.SelectedValue;
        objBEL.marritalstatus    = DropDownList11.SelectedValue;
        objBEL.username          = TextBox12.Text;
        objBEL.password          = TextBox13.Text;

        Label2.Text = objDAL.AddNonTeacher(objBEL);
        Response.Redirect("Login.aspx");
    }
        public int RegisterUser(string FirstName, string LastName, string Street, string Town, string Postcode, string Email, string Password)
        {
            try
            {
                RegisterDAL rUser = new RegisterDAL();
                if (rUser.checkEmail(Email) == 1)
                {
                    return(3);
                }

                else
                {
                    return(rUser.UserRegister(FirstName, LastName, Street, Town, Convert.ToInt32(Postcode), Email, Password));
                }
            }
            catch
            {
                throw;
            }
        }
示例#12
0
        private async void register_click(object sender, EventArgs e)
        {
            if (this.password_txtbox.Text != this.confirm_password_txtbox.Text)
            {
                this.display_error_message.Text      = "两次输入的密码不一致,请重新输入";
                this.display_error_message.ForeColor = Color.Red;
            }
            else
            {
                RegisterDAL    register = new RegisterDAL();
                ResponseResult result   = await register.Register(this.username_txtbox.Text, this.telephone_txtbox.Text, this.password_txtbox.Text);

                if (result.code == 0)
                {
                    this.Close();
                }
                else
                {
                    MessageBox.Show(result.message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
示例#13
0
        public void updateProfile()
        {
            RegisterDAL registerDAL = new RegisterDAL();

            registerDAL.updateProfile(this.userId, this.firstName, this.lastName, this.gender, this.birthday, this.email, this.occupation);
        }
示例#14
0
        public void register()
        {
            RegisterDAL registerDAL = new RegisterDAL();

            registerDAL.register(this.firstName, this.lastName, this.gender, this.birthday, this.occupation, this.email, this.password, this.role);
        }
示例#15
0
        // GET: Users
        public ActionResult Index()
        {
            var users = RegisterDAL.GetUsers();

            return(View(users));
        }
        protected void lnkbtnContinoue_OnClick(object sender, EventArgs e)
        {
            if (ViewState["OTP"] != null)
            {
                string OTP = ViewState["OTP"].ToString();
                if (OTP == txtMobileOtp.Text.Trim())
                {
                    string strMsg = string.Empty;

                    RegisterDAL objtblRegister  = new RegisterDAL();
                    Int64       intWorkCompIdno = 0;
                    string      CompName        = txtCompanyName.Text.Trim();
                    string      OwnerName       = txtOwnerName.Text.Trim();
                    string      LastName        = txtOwnerLast.Text.Trim();
                    //string Address1 = txtAdrs1.Text.Trim();
                    //string Address2 = txtAdrs2.Text.Trim();
                    //Int64 CityIdno = Convert.ToInt64(ddlCity.SelectedValue);
                    //Int64 StateIdno = Convert.ToInt64(ddlState.SelectedValue);
                    //string PinNo = Convert.ToString(txtpincode.Text.Trim());
                    string EmailId      = txtemailid.Text.Trim();
                    string PhneNum      = txtMobileNumber.Text.Trim();
                    string OwnMobileNum = txtMobileNumber.Text.Trim();

                    string Ipaddress = Request.UserHostAddress.ToString();

                    intWorkCompIdno = objtblRegister.Insert(CompName, OwnerName, LastName, EmailId, PhneNum, OwnMobileNum, Ipaddress, false);

                    if (intWorkCompIdno > 0)
                    {
                        #region ClientSMS & SMStoSir
                        string Clientsms = "Dear " + OwnerName + ", thank you for regsitering with us. We have received your request and we shall email you the login details very shortly.";

                        if (SendMsgForOTP(OwnMobileNum, Clientsms))
                        {
                            // sending sms to client
                        }

                        string Message = "Dear Sir, " + OwnerName + ", [" + OwnMobileNum + "], has submitted registration request for Web Transport.";
                        string MobNum  = "9829068896";;  // here num to send sms
                        if (SendMsgForOTP(MobNum, Message))
                        {
                            // sending sms to punitsir
                        }
                        #endregion

                        #region MailToClient & MailToAdmin
                        string           Subject        = "Registration";
                        string           EmailBody      = string.Empty;
                        tblEmailTemplate EmailTemplates = objtblRegister.SelectUserMailTemplates("Register");
                        EmailBody = EmailTemplates.Body.ToString();
                        EmailBody = EmailBody.Replace("$$UserName$$", OwnerName);

                        if (SendMailMessage(txtemailid.Text.Trim(), "", "", Subject, EmailBody))
                        {
                            // Sending mail to user
                        }

                        string           AdminEmailBody       = string.Empty;
                        tblEmailTemplate AdminstrSQLForTmplts = objtblRegister.SelectUserMailTemplates("Mail To Admin");
                        AdminEmailBody = AdminstrSQLForTmplts.Body.ToString();
                        AdminEmailBody = AdminEmailBody.Replace("$$UserName$$", OwnerName).Replace("$$MobileNum$$", OwnMobileNum).ToString();
                        string MailTo = "*****@*****.**"; // to add more mailid use ; keyword
                        if (SendMailMessage(MailTo, "", "", Subject, AdminEmailBody))
                        {
                            // Sending mail to Punit sir
                        }
                        #endregion
                        multivwRegstr.ActiveViewIndex = 0;
                        ClearControls();
                        lblMainSuccessMsg.Visible = true;
                        lblMainSuccessMsg.Text    = "Thank you for registration with us, we will revert back you soon.";
                    }
                    else
                    {
                        multivwRegstr.ActiveViewIndex = 0;
                        lblMainSuccessMsg.Visible     = true;
                        lblMainSuccessMsg.Text        = "Record already exists.";
                    }
                }
                else
                {
                    lblSuccessMsg.Visible   = true;
                    lblSuccessMsg.ForeColor = System.Drawing.Color.Red;
                    lblSuccessMsg.Text      = "OTP code does not match";

                    lnkbtnOTPSend.Visible = true;
                }
            }
            else
            {
                Response.Redirect("NewRegister.aspx");
            }
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        objBEL       = new StudentBEL();
        objDAL       = new RegisterDAL();
        objBEL.fname = TextBox1.Text;
        objBEL.mname = TextBox2.Text;
        objBEL.lname = TextBox3.Text;

        if (RadioButton1.Checked)
        {
            objBEL.gender = "male";
        }
        else
        {
            objBEL.gender = "female";
        }
        objBEL.contactNo = TextBox3.Text;
        objBEL.emailId   = TextBox4.Text;
        objBEL.bloodGrp  = DropDownList1.SelectedValue;
        objBEL.moName    = TextBox5.Text;
        objBEL.faName    = TextBox6.Text;
        objBEL.faOcc     = TextBox7.Text;
        objBEL.faCoNo    = TextBox8.Text;
        objBEL.addOfCo   = TextBox9.Text;
        objBEL.pAdd      = TextBox10.Text;
        objBEL.state     = DropDownList6.SelectedValue;
        objBEL.city      = DropDownList7.SelectedValue;
        objBEL.dob       = TextBox18.Text;

        Byte[] imgByte = null;
        if (FileUpload1.HasFile && FileUpload1.PostedFile != null)
        {
            HttpPostedFile File = FileUpload1.PostedFile;
            imgByte = new Byte[File.ContentLength];
            File.InputStream.Read(imgByte, 0, File.ContentLength);
        }
        objBEL.img = imgByte;

        if (RadioButton3.Checked)
        {
            objBEL.caste = "obc";
        }
        else
        if (RadioButton4.Checked)
        {
            objBEL.caste = "sc";
        }
        else
        if (RadioButton5.Checked)
        {
            objBEL.caste = "st";
        }
        else
        if (RadioButton6.Checked)
        {
            objBEL.caste = "NT";
        }
        else
        {
            objBEL.caste = "General";
        }


        objBEL.bPlace    = TextBox11.Text;
        objBEL.branch    = DropDownList2.SelectedValue;
        objBEL.course    = DropDownList5.SelectedValue;
        objBEL.year      = DropDownList3.SelectedValue;
        objBEL.yrOfAdmit = DropDownList12.SelectedValue;
        objBEL.rollno    = TextBox15.Text;
        objBEL.usernm    = TextBox12.Text;
        objBEL.pass      = TextBox13.Text;

        Label2.Text = objDAL.AddStudent(objBEL);

        Response.Redirect("Login.aspx");
    }