Exemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                BusinessLayer.RTOAdmin.RTOCounterStaffServiceManager serviceMgr = new BusinessLayer.RTOAdmin.RTOCounterStaffServiceManager();
                int    serviceentObj = 0;
                string CenterCode    = Session["CenterCode"].ToString();
                //string CenterCode ="C_";
                string Btntype      = btnSubmit.Text;
                int    servicecount = ServiceCheckBoxList.Items.Cast <ListItem>().Count(li => li.Selected);
                if (servicecount != 0)
                {
                    if (btnSubmit.Text == "Update")
                    {
                        serviceentObj = serviceMgr.admindltserviceBLL(CenterCode);
                    }

                    foreach (ListItem lst in ServiceCheckBoxList.Items)
                    {
                        if (lst.Selected == true)
                        {
                            string ServiceName    = lst.Text;
                            int    ServiceId      = Convert.ToInt32(lst.Value);
                            string date           = System.DateTime.Now.ToString("dd'/'MM'/'yyyy hh:mm tt");
                            int    chkServiceList = serviceMgr.AdminVerifyServiceBLL(ServiceName, ServiceId, CenterCode);
                            if (chkServiceList == 0)
                            {
                                serviceentObj = serviceMgr.adminchooseserviceBLL(ServiceName, ServiceId, CenterCode);
                            }
                            else
                            {
                                lst.Selected = false;
                            }
                        }
                    }
                }
                else
                {
                    Response.Write("<script language='javascript'>window.alert('Please Choose Sevice Name');</script>");
                    return;
                }
                if (serviceentObj > 0)
                {
                    Response.Write("<script language='javascript'>window.alert('Service Details Added SuccessFully');</script>");
                    ServiceCheckBoxList.ClearSelection();
                    ServiceCheckBoxListAll.Checked = false;
                    btnSubmit.Text = "Submit";
                }
            }
            catch { }
        }
Exemplo n.º 2
0
 protected void btnsubmit_Click(object sender, EventArgs e)
 {
     try
     {
         BusinessLayer.RTOAdmin.RTOCounterStaffServiceManager serviceMgr = new BusinessLayer.RTOAdmin.RTOCounterStaffServiceManager();
         int    serviceentObj = 0;
         string centercode    = Session["CenterCode"].ToString();
         string Btntype       = btnsubmit.Text;
         int    servicecount  = ServiceCheckBoxList.Items.Cast <ListItem>().Count(li => li.Selected);
         if (servicecount != 0)
         {
             foreach (ListItem lst in ServiceCheckBoxList.Items)
             {
                 if (lst.Selected == true)
                 {
                     string ServiceName = lst.Text;
                     int    ServiceId   = Convert.ToInt32(lst.Value);
                     int    Staffid     = Convert.ToInt32(ddlstaffname.SelectedItem.Value);
                     int    counterid   = Convert.ToInt32(ddlCounteName.SelectedItem.Value);
                     int    chkSSC      = serviceMgr.AssignverifySSCBLL(ServiceId, counterid, Staffid, centercode);
                     if (chkSSC == 0)
                     {
                         serviceentObj = serviceMgr.AssignBLL(ServiceId, Staffid, counterid, centercode);
                     }
                     else
                     {
                         lst.Selected = false;
                     }
                 }
             }
         }
         else
         {
             Response.Write("<script language='javascript'>window.alert('Please Choose Sevice Name');</script>");
             return;
         }
         if (serviceentObj > 0)
         {
             Response.Write("<script language='javascript'>window.alert('Staff Assigned SuccessFully');</script>");
             ServiceCheckBoxList.ClearSelection();
             ServiceCheckBoxListAll.Checked = false;
             ddlstaffname.SelectedValue     = "0";
             ddlCounteName.SelectedValue    = "0";
             btnsubmit.Text = "Submit";
         }
     }
     catch { }
 }
Exemplo n.º 3
0
 public void ChooseServise()
 {
     try
     {
         BusinessLayer.RTOAdmin.RTOCounterStaffServiceManager accMgr = new BusinessLayer.RTOAdmin.RTOCounterStaffServiceManager();
         Entities.RTOService entObj = new Entities.RTOService();
         DataTable           dt     = new DataTable();
         dt = accMgr.FillserviceBLL();
         if (dt.Rows.Count > 0)
         {
             ServiceCheckBoxList.DataSource     = dt;
             ServiceCheckBoxList.DataTextField  = "ServiceName_VCR";
             ServiceCheckBoxList.DataValueField = "ServiceID_INT";
             ServiceCheckBoxList.DataBind();
         }
     }
     catch { }
 }