Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmSalaryCalculation")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        MultiView1.SetActiveView(View1);
                        BindAllownce();
                        BindEmployee();
                        BindDeduction();
                        BindSalaryAllocation();
                    }
                }
                else
                {
                    Response.Redirect("~/frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("~/frmlogin.aspx", false);
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmSupplierPayment")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        BindSupplier();
                        GetSupplierTransactionList();
                        BindBanks();
                        MultiView1.SetActiveView(View2);
                    }
                }
                else
                {
                    Response.Redirect("~/frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("~/frmlogin.aspx", false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                if (entLogin != null)
                {
                    if (entLogin.UserType.Equals("Receptionist", StringComparison.CurrentCultureIgnoreCase) || entLogin.UserType.Equals("Admin", StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (!Page.IsPostBack)
                        {
                            GetInsurance();
                            ViewData.SetActiveView(View1);
                        }
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmIPDRegistrationBookReport")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        Session["MyFlag"] = string.Empty;
                        Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString());
                        //GetDeptCategory();
                    }
                }
                else
                {
                    Response.Redirect("~/frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("~/frmlogin.aspx", false);
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmInsuranceClaim")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        BindPatientList();
                        BindInsuranceComName();
                        Session["Myflag"] = string.Empty;
                        BindInsuranceClaim();
                        MultiView1.SetActiveView(View1);
                    }
                }
                else
                {
                    Response.Redirect("~/frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("~/frmlogin.aspx", false);
            }
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmSurgeryMaster")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        GetReligion();
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmMakeDischarge")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString());
                        BindPatients();
                        BindSurgery();
                        GetDischargeList();
                        MultiView1.SetActiveView(View2);
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmAllowanceDeduction")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!IsPostBack)
                    {
                        GetAllowanceDed();
                        RdAllowance.Checked = true;
                        lblDescription.Text = "Allowance Name";
                        lblAmount.Text      = "Allowance Amount";
                        MultiView1.SetActiveView(View1);
                    }
                }
                else
                {
                    Response.Redirect("~/frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("~/frmlogin.aspx", false);
            }
        }
Пример #9
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //      < connectionStrings >
        //< add name = "baglanti" connectionString = "Data Source=Oguzhan,1433; Initial Catalog = Mask; persist Security Info = True; User ID = sa; Password = 12344" providerName = "System.Data.SqlClient" />

        //   </ connectionStrings >

        //         SqlConnection bgl = new SqlConnection(ConfigurationManager.ConnectionStrings["baglanti"].ToString());
        //    bgl.Open();

        //    String query = "Select count(*) from Firma where Mail = N'" + txt_mail.Text + "' and Parola =  N'" + txt_parola.Text + "'";
        //    SqlCommand cmd =new SqlCommand(query,bgl);
        //    String output = cmd.ExecuteScalar().ToString();

        EntityLogin ent = new EntityLogin();

        ent.Email  = txt_mail.Text;
        ent.Parola = txt_parola.Text;
        DALkullanici.GirisKontrol(ent);

        if (DALkullanici.output == "1")
        {
            Response.Redirect("~/Admin/index.html");
        }
        else
        {
            txt_mail.Text   = "";
            txt_parola.Text = "";
            theDiv.Visible  = true;
            //  Response.Write("Kullanıcı adı veya parolanız hatalı!");
            // Response.Write("<script>alert('Kullanıcı adı veya parolanız hatalı!')</script>");
        }
    }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmUserAuthentication")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        GetForms();
                        BindDesignation();
                        MultiView1.SetActiveView(View1);
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("../frmlogin.aspx", false);
            }
        }
Пример #11
0
 /// <summary>
 /// 登录信息
 /// </summary>
 /// <param name="empNo"></param>
 /// <param name="dcLoginInfo"></param>
 /// <param name="dcHospitalInfo"></param>
 public void GetLoginInfo(string empNo, ref EntityLogin loginVo, ref EntityHospital hospitalVo)
 {
     using (BizLogin biz = new BizLogin())
     {
         biz.GetLoginInfo(empNo, ref loginVo, ref hospitalVo);
     }
 }
Пример #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                if (entLogin != null)
                {
                    if (entLogin.UserType.Equals("Lab", StringComparison.CurrentCultureIgnoreCase) || entLogin.UserType.Equals("Admin", StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (!Page.IsPostBack)
                        {
                            if (!Page.IsPostBack)
                            {
                                Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString());
                                GetUnits();
                                MultiView1.SetActiveView(View1);
                            }
                        }
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SessionWrapper.UserName == string.Empty || SessionWrapper.UserType != "A")
            {
                //Response.Redirect("Default.aspx");
            }
            else
            {
                lblUserName.Text = "Welcome : " + SessionWrapper.UserName;
            }
            EntityLogin entLogin = (EntityLogin)Session["user"];

            if (entLogin != null)
            {
                EntityEmployee entEmp = new EntityEmployee();
                entEmp.EmpFirstName   = new EmployeeBLL().GetEmpName(entLogin.UserName);
                lblUserName.Text      = "Welcome : " + entLogin.UserType;
                Session["UserType12"] = entLogin.UserType;
                Session["AdminName"]  = entEmp.EmpFirstName;
                if (!entLogin.UserType.Equals("admin", StringComparison.CurrentCultureIgnoreCase))
                {
                    AddForms(entEmp.EmpFirstName);
                    //Userauthenticate(entLogin);
                }
                else
                {
                    List <EntityFormMaster> entLstForms = new UserAuthenticationBLL().GetAllForms();
                    Session["AccessibleForm"] = entLstForms;
                }
            }
        }
Пример #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmAdmitPatient")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        GetPatientList();
                        GetDeptCategory();
                        ddlCompName.Enabled  = false;
                        ddlInsurance.Enabled = false;
                        GetOPDPatientList();
                        GetInsuranceCompanies();
                        GetCompanies();
                        MultiView1.SetActiveView(View1);
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
Пример #15
0
        public ActionResult Login(EntityLogin login)
        {
            var ret = _UserRepository.Login(login);

            if (ret == null)
            {
                return(StatusCode(401));
            }

            return(Json(ret));
        }
Пример #16
0
        public int BusinessLogins(EntityLogin entity)
        {
            int Result = 0;

            SqlParameter[] objDataParams = new SqlParameter[2];
            objDataParams[0]       = new SqlParameter("@Email", SqlDbType.VarChar, 50);
            objDataParams[0].Value = entity.Email;

            objDataParams[1]       = new SqlParameter("@Password", SqlDbType.VarChar, 50);
            objDataParams[1].Value = entity.Password;
            Result = DAL.DALLogins(objDataParams);

            return(Result);
        }
Пример #17
0
        public DataTable Checkpass(EntityLogin entLogin)
        {
            DataTable           ldt      = new DataTable();
            List <SqlParameter> lstparam = new List <SqlParameter>();

            try
            {
                Commons.ADDParameter(ref lstparam, "@UserName", DbType.String, entLogin.UserName);
                ldt = mobjDataAccess.GetDataTable("sp_CheckPass", lstparam);
            }
            catch (Exception ex)
            {
                Commons.FileLog("GetChangePasswordBLL -Checkpass(EntityLogin entChk)", ex);;
            }
            return(ldt);
        }
Пример #18
0
        protected void lnkLogOut_Click(object sender, EventArgs e)
        {
            EntityLogin UsersDat = (EntityLogin)Session["user"];

            for (int i = 0; i < Global.UsersData.Count; i++)
            {
                if (UsersDat.PKId == Global.UsersData[i].PKId)
                {
                    Global.UsersData.RemoveAt(i);
                }
            }

            Session["user"]       = null;
            Session["UserType12"] = null;
            Session["AdminName"]  = null;
            Response.Redirect("~/frmlogin.aspx", false);
        }
Пример #19
0
        public static int GirisKontrol(EntityLogin p)
        {
            SqlCommand komut = new SqlCommand("Select count(*) from Firma where Mail = '" + p.Email + "' and Parola = '" + p.Parola + "' ", BaglantiDB.bgldb);

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }
            SqlDataReader dr = komut.ExecuteReader();

            while (dr.Read())
            {
                output = dr[0].ToString();
            }
            dr.Close();
            return(komut.ExecuteNonQuery());
        }
Пример #20
0
        public int ChangePassword(EntityLogin entLogin)
        {
            int lintCnt = 0;
            List <SqlParameter> listparam = new List <SqlParameter>();

            try
            {
                Commons.ADDParameter(ref listparam, "@UserName", DbType.String, entLogin.UserName);
                Commons.ADDParameter(ref listparam, "@ConfirmPass", DbType.String, entLogin.ConfirmPass);
                lintCnt = mobjDataAccess.ExecuteQuery("sp_ChangePassword", listparam);
            }
            catch (Exception ex)
            {
                Commons.FileLog("GetLoginBLL - ChangePassword(EntityLogin entLogin)", ex);
            }
            return(lintCnt);
        }
Пример #21
0
        public DataTable GetLogin(EntityLogin entLogin)
        {
            DataTable           dt       = new DataTable();
            List <SqlParameter> lstParam = new List <SqlParameter>();

            try
            {
                Commons.ADDParameter(ref lstParam, "@UserName", DbType.String, entLogin.UserName);
                Commons.ADDParameter(ref lstParam, "@Password", DbType.String, entLogin.Password);
                Commons.ADDParameter(ref lstParam, "@UserType", DbType.String, entLogin.UserType);
                dt = mobjDataAccess.GetDataTable("sp_GetLogin", lstParam);
            }
            catch (Exception ex)
            {
                Commons.FileLog("GetLoginBLL - GetLogin(EntityLogin entLogin)", ex);
            }
            return(dt);
        }
Пример #22
0
        public BaseResponse Login(EntityLogin login)
        {
            var returnEntity = new BaseResponse();
            var entityUser   = new EntityLoginResponse();

            try
            {
                using (var db = GetSqlConnection())
                {
                    const string sql = @"usp_user_login";
                    var          p   = new DynamicParameters();
                    p.Add(name: "@LOGINUSUARIO", value: login.LoginUsuario, dbType: DbType.String, direction: ParameterDirection.Input);
                    p.Add(name: "@PASSWORDUSUARIO", value: login.PasswordUsuario, dbType: DbType.String, direction: ParameterDirection.Input);

                    entityUser = db.Query <EntityLoginResponse>(sql,
                                                                param: p, commandType: CommandType.StoredProcedure).FirstOrDefault();


                    if (entityUser != null)
                    {
                        returnEntity.isSuccess    = true;
                        returnEntity.errorCode    = "0000";
                        returnEntity.errorMessage = string.Empty;
                        returnEntity.data         = entityUser;
                    }
                    else
                    {
                        returnEntity.isSuccess    = false;
                        returnEntity.errorCode    = "0000";
                        returnEntity.errorMessage = string.Empty;
                        returnEntity.data         = null;
                    }
                }
            }
            catch (Exception ex)
            {
                returnEntity.isSuccess    = false;
                returnEntity.errorCode    = "0001";
                returnEntity.errorMessage = ex.Message;
                returnEntity.data         = null;
            }

            return(returnEntity);
        }
Пример #23
0
        public int Update(EntityLogin entLog)
        {
            int      Result  = 0;
            tblLogin objUser = (from tbl in objData.tblLogins
                                where tbl.PKId.Equals(entLog.PKId)
                                select tbl).FirstOrDefault();

            objUser.Password     = entLog.Password;
            objUser.IsFirstLogin = false;
            objData.SubmitChanges();
            if (objUser != null)
            {
                Result = 1;
            }
            else
            {
                Result = 0;
            }
            return(Result);
        }
Пример #24
0
        protected void BtnEdit_Click(object sender, EventArgs e)
        {
            EntityLogin  entLogin = (EntityLogin)Session["user"];
            tblPathology tblpath  = new tblPathology();

            tblpath.PatientId    = Convert.ToInt32(Session["T_Id"]);
            tblpath.TestId       = Convert.ToInt32(ddlTest.SelectedValue);
            tblpath.TestDate     = DateTime.Now.Date;
            tblpath.TestDoneById = entLogin.PKId;
            tblpath.LabId        = Convert.ToInt32(Session["LabId"]);
            tblpath.FinalComment = Convert.ToString(txtFinalComment.Text);
            List <tblPathologyDetail> lst = new List <tblPathologyDetail>();

            foreach (GridViewRow item in GridView1.Rows)
            {
                var textbox        = item.FindControl("txtResult") as TextBox;
                var a              = textbox.Text;
                var textboxCommnet = item.FindControl("ddlComment") as DropDownList;
                var comm           = textboxCommnet.SelectedItem.Text;
                var ddl            = item.FindControl("ddlUnit") as DropDownList;
                var unit           = ddl.SelectedValue;
                var ddltestMeth    = item.FindControl("ddlTestMethod") as DropDownList;
                var testmethod     = ddltestMeth.SelectedValue;
                lst.Add(new tblPathologyDetail
                {
                    LabId        = Convert.ToInt32(Session["LabId"]),
                    TestParaId   = Convert.ToInt32(GridView1.DataKeys[0].Value),
                    Result       = Convert.ToDecimal(a),
                    UnitId       = Convert.ToInt32(unit),
                    TestMethodId = Convert.ToInt32(testmethod),
                    Comment      = comm,
                    Isdelete     = false
                });
            }
            mobjDeptBLL.Update(lst, tblpath);
            BindPatientPathologyTest();
            lblMessage.Text = "Record Updated Sucessfully......";
            MultiView1.SetActiveView(View1);
        }
Пример #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                if (entFormAcc != null)
                {
                    int Access = (from tbl in entFormAcc
                                  where tbl.FormName.Contains("frmOPDPatientDetail")
                                  select tbl).Count();

                    if (Access > 0)
                    {
                        if (!Page.IsPostBack)
                        {
                            GetOPDPatientList();
                            pnlShow.Visible = true;
                            pnl.Visible     = true;
                            MultiView1.SetActiveView(View1);
                        }
                    }
                    else
                    {
                        Response.Redirect("frmAdminMain.aspx", false);
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
        public async Task <ActionResult> Login(EntityLogin login)
        {
            var ret = _UserRepository.Login(login);

            if (ret.data != null)
            {
                var responseLogin = ret.data as EntityLoginResponse;
                var userId        = responseLogin.IdUser.ToString();
                var userNom       = responseLogin.Nombres;

                var token = JsonConvert
                            .DeserializeObject <AccessToken>(
                    await new Authentication()
                    .GenerateToken(userNom, userId)
                    ).access_token;

                responseLogin.Token = token;
                ret.data            = responseLogin;
            }
            //return StatusCode(401);

            return(Json(ret));
        }
Пример #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmDatewiseConsultDoctorReport")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        Session["MyFlag"]      = string.Empty;
                        Session["update"]      = Server.UrlEncode(System.DateTime.Now.ToString());
                        lblamount.Visible      = false;
                        txtamount.Visible      = false;
                        txtPayable.Visible     = false;
                        lblPayable.Visible     = false;
                        lblRecoveryAmt.Visible = false;
                        txtRecovery.Visible    = false;
                        txtRecAmt.Visible      = false;
                        GetDeptCategory();
                    }
                }
                else
                {
                    Response.Redirect("~/frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("~/frmlogin.aspx", false);
            }
        }
Пример #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin             entLogin   = (EntityLogin)Session["user"];
                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmEmployeeMaster")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        GetEmployee();
                        BindDesignation();
                        GetDepartments();
                        //GetDepartmentsForEdit();
                        //CalendarExtender1.EndDate = DateTime.Now;
                        //CalendarExtender1.StartDate = DateTime.Now.AddYears(-60);
                        //CalDOBDate.StartDate = DateTime.Now.Date.AddYears(-60);
                        //CalDOBDate.EndDate = DateTime.Now.Date;
                        btnUpdate.Visible = false;
                        BtnSave.Visible   = true;
                        MultiView1.SetActiveView(View1);
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
Пример #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                EntityLogin entLogin = (EntityLogin)Session["user"];

                List <EntityFormMaster> entFormAcc = (List <EntityFormMaster>)Session["AccessibleForm"];
                int Access = (from tbl in entFormAcc
                              where tbl.FormName.Contains("frmPathology")
                              select tbl).Count();

                if (Access > 0)
                {
                    if (!Page.IsPostBack)
                    {
                        Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString());
                        BindPatientList();
                        BindPatientPathologyTest();
                        lblFinalComment.Visible = false;
                        txtFinalComment.Visible = false;
                        lblMessage.Text         = string.Empty;
                        imgUpload.Visible       = false;
                        lblUpload.Visible       = false;
                        BtnimgUpload.Visible    = false;
                        MultiView1.SetActiveView(View1);
                    }
                }
                else
                {
                    Response.Redirect("frmAdminMain.aspx", false);
                }
            }
            else
            {
                Response.Redirect("frmlogin.aspx", false);
            }
        }
Пример #30
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ddlPatient.SelectedIndex == 0)
                {
                    lblMsg.Text = "Please Select Patient";
                    ddlPatient.SelectedIndex = 0;
                    ddlPatient.Focus();
                }
                if (ddlTest.SelectedIndex == 0)
                {
                    lblMsg.Text           = "Please Select Test";
                    ddlTest.SelectedIndex = 0;
                    ddlTest.Focus();
                }
                if (txtFinalComment.Text == null)
                {
                    lblMsg.Text           = "Please Enter Final Comment";
                    ddlTest.SelectedIndex = 0;
                    ddlTest.Focus();
                    return;
                }
                bool flag = false;
                List <tblPathologyDetail> lst = new List <tblPathologyDetail>();
                foreach (GridViewRow item in GridView1.Rows)
                {
                    var textbox = item.FindControl("txtResult") as TextBox;
                    var a       = textbox.Text;
                    if (string.IsNullOrEmpty(a))
                    {
                        flag = true;
                        break;
                    }
                    var textboxCommnet = item.FindControl("ddlComment") as DropDownList;
                    var comm           = textboxCommnet.SelectedItem.Text;
                    if (string.IsNullOrEmpty(comm))
                    {
                        flag = true;
                        break;
                    }
                    var ddl  = item.FindControl("ddlUnit") as DropDownList;
                    int unit = Convert.ToInt32(ddl.SelectedValue);
                    if (unit == 0)
                    {
                        flag = true;
                        break;
                    }
                    var ddltestMeth = item.FindControl("ddlTestMethod") as DropDownList;
                    int testmethod  = Convert.ToInt32(ddltestMeth.SelectedValue);
                    if (testmethod == 0)
                    {
                        flag = true;
                        break;
                    }
                    lst.Add(new tblPathologyDetail {
                        TestParaId = Convert.ToInt32(GridView1.DataKeys[item.RowIndex].Value), Result = Convert.ToDecimal(a), UnitId = Convert.ToInt32(unit), TestMethodId = Convert.ToInt32(testmethod), Comment = comm, Isdelete = false
                    });
                }

                if (flag)
                {
                    lblMsg.Text = "Please Fill Valid & Complete Data";
                }
                else
                {
                    EntityLogin entLogin = (EntityLogin)Session["user"];

                    PathologyBLL PBll      = new PathologyBLL();
                    tblPathology pathology = new tblPathology();
                    pathology.PatientId    = Convert.ToInt32(ddlPatient.SelectedValue);
                    pathology.TestId       = Convert.ToInt32(ddlTest.SelectedValue);
                    pathology.TestDate     = DateTime.Now.Date;
                    pathology.FinalComment = txtFinalComment.Text;
                    pathology.TestDoneById = entLogin.PKId;
                    HttpPostedFile File = (HttpPostedFile)Session["Photo"];
                    if (File != null)
                    {
                        string appPath = Server.MapPath("~/PathologyImages/");
                        string Id      = Convert.ToString(mobjDeptBLL.GetLabId());
                        File.SaveAs(appPath + Id + ".jpg");
                    }

                    int i = PBll.Save(pathology, lst);
                    lblMessage.Text = "Record Saved Sucessfully";
                    BindPatientPathologyTest();
                    MultiView1.SetActiveView(View1);
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = ex.Message;
            }
        }