Example #1
0
 public void DivMasterManage()
 {
     if (Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.Admin.ToLower())
     {
         Timer1.Enabled = true;
         //Timer2.Enabled = true;
         divAdmin.Visible      = true;
         divBranch.Visible     = false;
         divSuperAdmin.Visible = false;
         divBuyer.Visible      = false;
         divSupplier.Visible   = false;
     }
     else if (Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.Branch.ToLower())
     {
         DataTable dt = Session["dtLoginDetails"] as DataTable;
         lblICS.Text = dt.Rows[0]["UserLoginID"].ToString();
         BranchOrderTrans.Enabled = true;
         divBranch.Visible        = true;
         divAdmin.Visible         = false;
         divSuperAdmin.Visible    = false;
         divBuyer.Visible         = false;
         divSupplier.Visible      = false;
     }
     else if (Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.Buyer.ToLower())
     {
         //Timer23.Enabled = true;
         DataTable dtBuyer = new DataTable();
         dtBuyer = BBL.BuyerDetails(Session["BuyerId"].ToString());
         if (dtBuyer.Rows.Count > 0)
         {
             lblBuyerName.Text     = dtBuyer.Rows[0]["BuyerCompanyName"].ToString().ToUpper();
             divBranch.Visible     = false;
             divAdmin.Visible      = false;
             divBuyer.Visible      = true;
             divSuperAdmin.Visible = false;
             divSupplier.Visible   = false;
         }
     }
     else if (Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.SuperAdmin.ToLower())
     {
         Transaction.Enabled   = true;
         divBranch.Visible     = false;
         divAdmin.Visible      = false;
         divBuyer.Visible      = false;
         divSuperAdmin.Visible = true;
         divSupplier.Visible   = false;
     }
     else if (Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.Supplier.ToLower())
     {
         BranchOrderTrans.Enabled = true;
         DataTable dt = Session["dtLoginDetails"] as DataTable;
         if (dt.Rows.Count > 0)
         {
             DataTable dtIS = lbl.GetSupplierName(dt.Rows[0]["UserId"].ToString());
             if (dtIS.Rows.Count > 0)
             {
                 lblIS.Text = dtIS.Rows[0]["SupplierCompanyName"].ToString();
             }
         }
         divBranch.Visible     = false;
         divAdmin.Visible      = false;
         divBuyer.Visible      = false;
         divSuperAdmin.Visible = false;
         divSupplier.Visible   = true;
     }
     else
     {
         divBranch.Visible     = false;
         divAdmin.Visible      = false;
         divBuyer.Visible      = false;
         divSuperAdmin.Visible = false;
         divSupplier.Visible   = false;
     }
 }