示例#1
0
文件: BLlogin.cs 项目: ttss2272/bc
        public string InsertUserDetails(EntLogin objentlogin)
        {
            string strMessage = "Data Saved";
            DlLogin objdllogin = new DlLogin();
            try
            {
                return objdllogin.InsertUserInformation(objentlogin);//pass entity object

            }

            catch (Exception ex)
            {

              // MessageBox.Show(ex.Message.ToString());

            }

            finally
            {

                objdllogin = null;

            }
            return strMessage;
        }
示例#2
0
文件: DlLogin.cs 项目: ttss2272/bc
        public string InsertUserInformation(EntLogin objentlogin)
        {
            string msg = "Saved";
            SqlConnection con = new SqlConnection(ConnectionString);

            con.Open();

            SqlCommand cmd = new SqlCommand("GetLoginDetails", con);

            cmd.CommandType = CommandType.StoredProcedure;

            try
            {

                cmd.Parameters.AddWithValue("@LoginuserId",objentlogin.LoginuserId);
                cmd.Parameters.AddWithValue("@LoginTypeId",objentlogin.LoginTypeId);
                cmd.Parameters.AddWithValue("@LoginUserName", objentlogin.LoginUserName);
                cmd.Parameters.AddWithValue("@Password", objentlogin.Password);
                cmd.ExecuteNonQuery();
                string strMessage = "User registred";

                con.Close();

                return strMessage;

            }

            catch (Exception ex)
            {

              // MessageBox.Show(ex.Message.ToString());

            }

            finally
            {

                cmd.Dispose();

                con.Close();

                con.Dispose();

            }
            return msg;
        }