コード例 #1
0
ファイル: DataLayer.cs プロジェクト: sahibealam/My_Takis
    public DataSet Account_check(save_account obj)
    {
        DataSet ds      = new DataSet();
        string  strQuer = "";

        strQuer = "set dateformat dmy; select save_email,save_mobile from save_account where save_email='" + obj.save_email + "' and save_mobile='" + obj.save_mobile + "' ";
        try
        {
            ds = ExecuteSelectQuery(strQuer);
        }
        catch (Exception ee)
        {
            ds = null;
        }
        return(ds);
    }
コード例 #2
0
ファイル: DataLayer.cs プロジェクト: sahibealam/My_Takis
    public bool Account_savebtn(save_account objSaa)
    {
        bool   flag    = false;
        string strQuer = "";

        strQuer = "set dateformat dmy; insert into save_account ([save_name],[save_Username],[save_mobile],[save_email],[save_password],[save_confirmpassword],[save_gender],[save_age])values('" + objSaa.save_name + "','" + objSaa.save_Username + "','" + objSaa.save_mobile + "','" + objSaa.save_email + "','" + objSaa.save_password + "','" + objSaa.save_confirmpassword + "','" + objSaa.save_gender + "','" + objSaa.save_age + "' where save_status=1);select @@Identity";
        try
        {
            ExecuteSelectQuery(strQuer);
            flag = true;
        }
        catch (Exception ee)
        {
            flag = false;
        }
        return(flag);
    }
コード例 #3
0
ファイル: DataLayer.cs プロジェクト: sahibealam/My_Takis
    public bool Update_save_account(save_account obj_save_account)
    {
        bool   flag     = false;
        string strQuery = "";

        strQuery = " set dateformat dmy;Update  save_account set  save_name = N'" + obj_save_account.save_name + "', save_ModifiedOn = getdate(), save_ModifiedBy = '" + obj_save_account.save_AddedBy + "' where save_id = '" + obj_save_account.save_id + "' and save_status = '" + obj_save_account.save_status + "' ";
        if (obj_save_account != null)
        {
            ExecuteSelectQuery(strQuery);
            flag = true;
        }
        else
        {
            //ExecuteSelectQuerywithTransaction(strQuery);
            flag = true;
        }
        return(flag);
    }
コード例 #4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        save_account obj_save_account = new save_account();

        try
        {
            obj_save_account.save_id = Convert.ToInt32(hf_save_id.Value);
        }
        catch
        {
            obj_save_account.save_id = 0;
        }

        if (txtPersonName.Text.Trim() == "")
        {
            MessageBox.Show("Please Provide Name!!");
            txtPersonName.Focus();

            return;
        }
        if (txtUserName.Text.Trim() == "")
        {
            MessageBox.Show("Please Provide User Name!!");
            txtUserName.Focus();

            return;
        }

        if (txtMobile.Text.Trim() == "")
        {
            MessageBox.Show("Please Provide Mobile Number!!");
            txtMobile.Focus();

            return;
        }
        if (txtEmail.Text.Trim() == "")
        {
            MessageBox.Show("Please Provide Email!!");
            txtEmail.Focus();
        }
        if (txtPassword.Text.Trim() == "")
        {
            MessageBox.Show("Please  Provide Password!!");
            txtPassword.Focus();
        }
        if (txtConfirmPassword.Text.Trim() == "")
        {
            MessageBox.Show("Please  Confirm Password!!");
            txtConfirmPassword.Focus();
        }
        if (ddlGender.SelectedValue == "0")
        {
            MessageBox.Show("Please select Gender!!");
            ddlGender.Focus();
        }
        if (txtAge.Text.Trim() == "")
        {
            MessageBox.Show("Please Fill Age!!");
            txtAge.Focus();
        }

        obj_save_account.save_name            = txtPersonName.Text.Trim();
        obj_save_account.save_Username        = txtUserName.Text.Trim();
        obj_save_account.save_mobile          = txtMobile.Text.Trim();
        obj_save_account.save_email           = txtEmail.Text.Trim();
        obj_save_account.save_password        = txtPassword.Text.Trim();
        obj_save_account.save_confirmpassword = txtConfirmPassword.Text.Trim();
        obj_save_account.save_gender          = ddlGender.Text.Trim();
        obj_save_account.save_age             = txtAge.Text.Trim();
        DataSet sa = new DataLayer().Account_check(obj_save_account);

        if (hf_save_id == null)
        {
            if (sa != null && sa.Tables.Count > 0 && sa.Tables[0].Rows.Count > 0)
            {
                MessageBox.Show("Email already Exist OR Mobile alredy Exist!!");
            }
            else if (new DataLayer().Account_savebtn(obj_save_account))
            {
                MessageBox.Show("Account Created Successfully!!");
            }
        }
        else
        {
            int     save_id = 0;
            DataSet ds      = new DataSet();
            ds = (new DataLayer()).Edit(Convert.ToInt32(save_id));
            if ((new DataLayer()).Update_save_account(obj_save_account))
            {
                MessageBox.Show("Account Updated Successfully!!");
                return;
            }
            else
            {
                MessageBox.Show("Error In Account Updation!!");
                return;
            }
        }
    }