Exemple #1
0
 protected void getItems()
 {
     objPRReq.OID = oid;
     if (start.Text == "" && end.Text == "" && ddl_fy.SelectedIndex == 0)
     {
         PRResp    resp = objPRIBC.getAllItemInventoryNotAbandoned(objPRReq);
         DataTable dt   = resp.GetTable;
         rptr_Inventory.DataSource = dt;
         rptr_Inventory.DataBind();
         stdate.Text  = new DateTime(2000, 1, 1).ToString("dd/MM/yyyy");
         enddate.Text = DateTime.Now.ToString("dd/MM/yyyy");
     }
     else
     {
         try
         {
             objPRReq.StartDate = DateTime.ParseExact(start.Text, "dd/MM/yyyy", null);
             objPRReq.EndDate   = DateTime.ParseExact(end.Text, "dd/MM/yyyy", null);
             PRResp    resp = objPRIBC.getAllItemInventoryNotAbandonedByDate(objPRReq);
             DataTable dt   = resp.GetTable;
             rptr_Inventory.DataSource = dt;
             rptr_Inventory.DataBind();
             stdate.Text  = start.Text;
             enddate.Text = end.Text;
         }
         catch (Exception ex)
         {
             string msg = ex.Message.Replace("'", ""); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('" + msg.ToString() + "');", true);
         }
     }
 }
Exemple #2
0
 public void getSerialNos()
 {
     if (ddl_ItemType.SelectedIndex > 0)
     {
         objPRReq.ITID   = int.Parse(ddl_ItemType.SelectedValue.ToString());
         objPRReq.OID    = oid;
         objPRReq.Status = "Idle";
         PRResp    r  = objPRIBC.getItemInventory4SerialNobyStatus(objPRReq);
         DataTable dt = r.GetTable;
         if (dt.Rows.Count > 0)
         {
             dt.DefaultView.Sort         = "SerialNo Asc";
             ddl_SerialNo.DataSource     = dt;
             ddl_SerialNo.DataTextField  = "SerialNo";
             ddl_SerialNo.DataValueField = "IID";
             ddl_SerialNo.DataBind();
             ddl_SerialNo.Items.Insert(0, "--Select SerialNo--");
         }
         else
         {
             ddl_SerialNo.Items.Clear();
             ddl_SerialNo.Items.Insert(0, "--No Data found--");
             ddl_SerialNo.DataBind();
         }
     }
 }
 protected void btn_Submit_Click(object sender, EventArgs e)
 {
     try
     {
         if (ddl_manufacturer.SelectedIndex == 0)
         {
             string msg = "Please Select a Manufacturer..!!!";
             throw new Exception(msg);
         }
         objPRReq.Manufacturer = ddl_manufacturer.SelectedItem.Text;
         objPRReq.ModelType    = convertQuotes(txt_model.Text.Trim());
         PRResp    r  = objPRIBC.getModelByName(objPRReq);
         DataTable dt = r.GetTable;
         if (dt.Rows.Count > 0)
         {
             string msg = "Model " + txt_model.Text.Trim() + ", Manufacturer " + objPRReq.Manufacturer + " already registered..!!!";
             throw new Exception(msg);
         }
         if (btn_Submit.Text != "Update")
         {
             objPRIBC.AddModel(objPRReq);
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", " alert('Model Added Successfully..!!!'); window.open('../CIT_Models/{0}','_self');", true);
         }
         else
         {
             objPRReq.ID = int.Parse(Request.QueryString["st"].ToString());
             objPRIBC.EditModelByMID(objPRReq);
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", " alert('Model Updated Successfully..!!!'); window.open('../CIT_Models/{0}','_self');", true);
         }
     }
     catch (Exception ex)
     {
         string msg = ex.Message.Replace("'", ""); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('" + msg + "');", true);
     }
 }
 protected void btn_Submit_Click(object sender, EventArgs e)
 {
     try
     {
         objPRReq.RoleType = convertQuotes(txt_application.Text.Trim());
         try
         {
             objPRReq.Role = int.Parse(txt_role.Text.Trim());
         }
         catch
         {
             throw new Exception("Enter only a number in Role Number");
         }
         PRResp    r  = objPRIBC.getARole(objPRReq);
         DataTable dt = r.GetTable;
         if (dt.Rows.Count > 0)
         {
             string msg = "Role " + txt_application.Text.Trim() + " already registered..!!!";
             throw new Exception(msg);
         }
         objPRIBC.AddRoleTable(objPRReq);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", " alert('Role Added Successfully..!!!'); window.open('../AddRole/{0}','_self');", true);
     }
     catch (Exception ex)
     {
         string msg = ex.Message.Replace("'", ""); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('" + msg + "');", true);
     }
 }
 protected void rptr_Inventory_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "make")
     {
         objPRReq.Manufacturer = e.CommandArgument.ToString();
         objPRReq.OID          = 1;
         PRResp    r  = objPRIBC.getItemInventory_Manufacturer(objPRReq);
         DataTable dt = r.GetTable;
         rptr_list.DataSource = dt;
         rptr_list.DataBind();
         heading.Text = "Manufacturer: " + e.CommandArgument.ToString();;
     }
     else
     {
         string[] args = e.CommandArgument.ToString().Split('|');
         objPRReq.Manufacturer = args[0];
         objPRReq.ItemName     = args[1];
         objPRReq.OID          = 1;
         PRResp    r  = objPRIBC.getItemInventory_Manufacturer_ItemName(objPRReq);
         DataTable dt = r.GetTable;
         rptr_list.DataSource = dt;
         rptr_list.DataBind();
         heading.Text = "Manufacturer: " + args[0] + " , " + args[1];
     }
     ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "pop", "show();", true);
 }
Exemple #6
0
 public void getCITInventory()
 {
     if (ddl_EmpName.SelectedIndex > 0)
     {
         objPRReq.Status = "Active";
         objPRReq.OID    = oid;
         objPRReq.Flag1  = 1;
         objPRReq.EmpID  = int.Parse(ddl_EmpName.SelectedValue.ToString());
         PRResp    rr  = objPRIBC.getEmp_MonthlySalayByEmpID_Status(objPRReq);
         DataTable drr = rr.GetTable;
         if (drr.Rows.Count > 0)
         {
             dl_EmpDetails.DataSource = drr;
             dl_EmpDetails.DataBind();
             DateTime dob = DateTime.Parse(drr.Rows[0]["DOB"].ToString());
             DateTime dor = dob.AddYears(60);
             // Retirement Date
             Label lbl_dor = (Label)dl_EmpDetails.Items[0].FindControl("lbl_DOR");
             lbl_dor.Text = dor.ToString("dd/MM/yyyy");
             // Current age
             Label    lblage = (Label)dl_EmpDetails.Items[0].FindControl("lbl_Age");
             DateTime now    = DateTime.Now;
             TimeSpan ts     = now - dob;
             double   year   = (ts).Days / 365;
             lblage.Text = year.ToString();
         }
         else
         {
             dl_EmpDetails.DataSource = null;
             dl_EmpDetails.DataBind();
         }
         PRResp    r  = objPRIBC.getAllMappedInventory_EmpID(objPRReq);
         DataTable dt = r.GetTable;
         //if (dt.Rows.Count > 0)
         //{
         rptr_Items.DataSource = dt;
         rptr_Items.DataBind();
         //Label lblName =rptr_Items.FindControl("lbl_Name") as Label;
         //lblName.Text = uname.ToUpper();
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             DataList dl = (DataList)rptr_Items.Items[i].FindControl("dl_CITData");
             objPRReq.ITID  = int.Parse(dt.Rows[i]["ITID"].ToString());
             objPRReq.EmpID = int.Parse(ddl_EmpName.SelectedValue.ToString());
             PRResp    rk  = objPRIBC.getAllMappedInventory_ITID_EmpID(objPRReq);
             DataTable dtk = rk.GetTable;
             if (dtk.Rows.Count > 0)
             {
                 dl.DataSource = dtk;
                 dl.DataBind();
             }
             else
             {
                 dl.DataSource = dtk;
                 dl.DataBind();
             }
         }
         //}
     }
 }
    public void getAllInvItems()
    {
        objPRReq.OID    = oid;
        objPRReq.Status = "Active";
        PRResp    r  = objPRIBC.getMappedInventoryMakeWise(objPRReq);
        DataTable dt = r.GetTable;

        rptr_Inventory.DataSource = dt;
        rptr_Inventory.DataBind();
        lbl_Count.Text     = "No.of Items Listed : " + dt.Rows.Count.ToString();
        lbl_ItemCount.Text = "No.of Items Listed : " + dt.Rows.Count.ToString();
        lbl_Dated.Text     = DateTime.Now.ToString();
        int d = dt.Select().Sum(v => Convert.ToInt32(v["Desktop"]));
        int l = dt.Select().Sum(v => Convert.ToInt32(v["Laptop"]));
        int p = dt.Select().Sum(v => Convert.ToInt32(v["Printer"]));
        int s = dt.Select().Sum(v => Convert.ToInt32(v["Scanner"]));
        int a = dt.Select().Sum(v => Convert.ToInt32(v["All-in-One"]));
        int t = dt.Select().Sum(v => Convert.ToInt32(v["Tablet"]));

        (rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("d") as Label).Text = d.ToString();
        (rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("l") as Label).Text = l.ToString();
        (rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("p") as Label).Text = p.ToString();
        (rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("s") as Label).Text = s.ToString();
        (rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("a") as Label).Text = a.ToString();
        (rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("t") as Label).Text = t.ToString();
    }
Exemple #8
0
 protected void rptr_Inventory_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "dept")
     {
         objPRReq.DeptID = e.CommandArgument.ToString();
         objPRReq.Status = "Active";
         objPRReq.OID    = 1;
         PRResp    r  = objPRIBC.getAllItemInventoryByDeptID(objPRReq);
         DataTable dt = r.GetTable;
         rptr_list.DataSource = dt;
         rptr_list.DataBind();
         heading.Text = "Department: " + e.CommandArgument.ToString();;
     }
     else
     {
         string[] args = e.CommandArgument.ToString().Split('|');
         objPRReq.DeptID   = args[0];
         objPRReq.ItemName = args[1];
         objPRReq.Status   = "Active";
         objPRReq.OID      = 1;
         PRResp    r  = objPRIBC.getAllItemInventory_DeptID_ItemName(objPRReq);
         DataTable dt = r.GetTable;
         rptr_list.DataSource = dt;
         rptr_list.DataBind();
         heading.Text = "Department: " + args[0] + " , " + args[1];
     }
     ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "pop", "show();", true);
 }
 protected void btn_Submit_Click(object sender, EventArgs e)
 {
     try
     {
         objPRReq.Status   = "Active";
         objPRReq.OID      = oid;
         objPRReq.ItemType = convertQuotes(txt_ItemType.Text.Trim());
         if (btn_Submit.Text != "Update")
         {
             PRResp    r  = objPRIBC.getItemTypeByName(objPRReq);
             DataTable dt = r.GetTable;
             if (dt.Rows.Count > 0)
             {
                 string msg = "ItemType of" + txt_ItemType.Text.Trim() + " already registered..!!!";
                 ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('" + msg + "');", true);
             }
             else
             {
                 objPRIBC.AddItemType(objPRReq);
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", " alert('Item Type Added Successfully..!!!'); window.open('../CIT_InvItems/{0}','_self');", true);
             }
         }
         else
         {
             objPRReq.ITID = int.Parse(Request.QueryString["st"].ToString());
             objPRIBC.EditItemTypeByOID(objPRReq);
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", " alert('Item Type Updated Successfully..!!!'); window.open('../CIT_InvItems/{0}','_self');", true);
         }
     }
     catch (Exception ex)
     {
         string msg = ex.Message.Replace("'", ""); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('" + msg + "');", true);
     }
 }
Exemple #10
0
 public void getSerialNoDetails()
 {
     if (ddl_ItemType.SelectedIndex > 0)
     {
         objPRReq.ITID     = int.Parse(ddl_ItemType.SelectedValue.ToString());
         objPRReq.SerialNo = ddl_SerialNo.SelectedItem.Text.Trim();
         objPRReq.OID      = oid;
         PRResp    r  = objPRIBC.getItemInventory_SerialNo(objPRReq);
         DataTable dt = r.GetTable;
         if (dt.Rows.Count > 0)
         {
             lbl_Model.Text        = dt.Rows[0]["Model"].ToString();
             lbl_SerialNo.Text     = dt.Rows[0]["SerialNo"].ToString();
             lbl_Warranty.Text     = dt.Rows[0]["Warranty"].ToString();
             lbl_Manufacturer.Text = dt.Rows[0]["Manufacturer"].ToString();
             lbl_ItemNo.Text       = dt.Rows[0]["ComputerNumber"].ToString();
         }
         else
         {
             lbl_Model.Text        = "";
             lbl_SerialNo.Text     = "";
             lbl_Warranty.Text     = "";
             lbl_Manufacturer.Text = "";
             lbl_ItemNo.Text       = "";
         }
     }
 }
 public void getAdminUser()
 {
     if (Session["UserID"].ToString() != "")
     {
         objPRReq.Status = "Active";
         objPRReq.UID    = int.Parse(Session["UserID"].ToString());
         PRResp    resp = objPRIBC.getAdminData(objPRReq);
         DataTable dt   = resp.GetTable;
         if (dt.Rows.Count > 0 && dt.Rows[0]["Role"].ToString() == "0")
         {
             oid  = int.Parse(dt.Rows[0]["OID"].ToString());
             name = dt.Rows[0]["Name"].ToString();
         }
         else
         {
             Session.Abandon();
             ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('Unauthorized User. Access Denied. Please Login on this Page.');window.open('../Admin/Default.aspx','_self');", true);
         }
     }
     else
     {
         Session.Abandon();
         Response.Redirect("~/Admin/Default.aspx");
     }
 }
Exemple #12
0
 public void getEmpDetails()
 {
     if (ddl_EmpType.SelectedIndex > 0 && ddl_EmpName.SelectedIndex > 0)
     {
         objPRReq.OID    = oid;
         objPRReq.Status = "Active";
         objPRReq.EmpID  = int.Parse(ddl_EmpName.SelectedValue.ToString());
         if (ddl_EmpType.SelectedItem.Text != "Project Staff")
         {
             PRResp    r  = objPRIBC.getEmpDetails_EmpID(objPRReq);
             DataTable dt = r.GetTable;
             if (dt.Rows.Count > 0)
             {
                 lbl_Dept.Text    = dt.Rows[0]["DeptID"].ToString();
                 lbl_EmpID.Text   = dt.Rows[0]["EmpID"].ToString();
                 lbl_Name.Text    = dt.Rows[0]["Name"].ToString() + "(" + lbl_EmpID.Text + ")";
                 Label2.Text      = dt.Rows[0]["Name"].ToString();
                 lbl_Design.Text  = dt.Rows[0]["Design"].ToString();
                 hdn_DID.Value    = dt.Rows[0]["DID"].ToString();
                 hdn_Email.Value  = dt.Rows[0]["Email"].ToString();
                 hdn_Mobile.Value = dt.Rows[0]["Mobile"].ToString();
             }
             else
             {
                 lbl_Dept.Text   = "";
                 lbl_EmpID.Text  = "";
                 lbl_Name.Text   = "";
                 lbl_Design.Text = "";
             }
         }
         else
         {
             PRResp    r  = objPRIBC.getPSEmpDetails_EmpID(objPRReq);
             DataTable dt = r.GetTable;
             if (dt.Rows.Count > 0)
             {
                 lbl_Dept.Text    = dt.Rows[0]["DeptID"].ToString();
                 lbl_EmpID.Text   = dt.Rows[0]["EmpID"].ToString();
                 lbl_Name.Text    = dt.Rows[0]["Name"].ToString() + "(" + lbl_EmpID.Text + ")";
                 Label2.Text      = dt.Rows[0]["Name"].ToString();
                 lbl_Design.Text  = dt.Rows[0]["Design"].ToString();
                 hdn_DID.Value    = dt.Rows[0]["DID"].ToString();
                 hdn_Email.Value  = dt.Rows[0]["Email"].ToString();
                 hdn_Mobile.Value = dt.Rows[0]["Mobile"].ToString();
             }
             else
             {
                 lbl_Dept.Text   = "";
                 lbl_EmpID.Text  = "";
                 lbl_Name.Text   = "";
                 lbl_Design.Text = "";
                 Label2.Text     = "";
             }
         }
         getCITInventory();
     }
 }
Exemple #13
0
    public void getAssignedRoles()
    {
        objPRReq.Status = "Active";
        PRResp    r  = objPRIBC.getAllAdmins(objPRReq);
        DataTable dt = r.GetTable;

        rptr_InventoryData.DataSource = dt;
        rptr_InventoryData.DataBind();
    }
Exemple #14
0
    public void getRoles()
    {
        PRResp    r  = objPRIBC.getRoles(objPRReq);
        DataTable dt = r.GetTable;

        ddl_roles.DataSource     = dt;
        ddl_roles.DataTextField  = "Application";
        ddl_roles.DataValueField = "Role";
        ddl_roles.DataBind();
    }
Exemple #15
0
    public void getManufacturers()
    {
        PRResp    r  = objPRIBC.getAllManufacturers(objPRReq);
        DataTable dt = r.GetTable;

        ddl_Manufacturer.DataSource     = dt;
        ddl_Manufacturer.DataTextField  = "Name";
        ddl_Manufacturer.DataValueField = "Name";
        ddl_Manufacturer.DataBind();
        ddl_Manufacturer.Items.Insert(0, "--Select Manufacturer--");
    }
    public void getAllRoles()
    {
        objPRReq.Status = "Active";
        objPRReq.OID    = oid;
        PRResp    r  = objPRIBC.getRoles(objPRReq);
        DataTable dt = r.GetTable;

        dt.DefaultView.Sort  = "Role asc";
        rptr_Data.DataSource = dt;
        rptr_Data.DataBind();
        lbl_Count.Text = " No. of Roles Listed : " + dt.Rows.Count.ToString();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     getAdminUser();
     ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "dt", "dt();", true);
     if (!IsPostBack)
     {
         PRResp    r  = objPRIBC.getMaxRole(objPRReq);
         DataTable dt = r.GetTable;
         txt_role.Text = (int.Parse(dt.Rows[0].ItemArray[0].ToString()) + 1).ToString();
         getAllRoles();
     }
 }
    public void Update()
    {
        objPRReq.ID     = int.Parse(Request.QueryString["st"].ToString());
        objPRReq.Status = "Active";
        PRResp    r  = objPRIBC.getManufacturerByMID(objPRReq);
        DataTable dt = r.GetTable;

        if (dt.Rows.Count > 0)
        {
            txt_Manufacturer.Text = dt.Rows[0]["Name"].ToString();
            btn_Submit.Text       = "Update";
        }
    }
Exemple #19
0
    public void getSectionOfCenter()
    {
        objPRReq.Status = "Active";
        objPRReq.OID    = oid;
        PRResp    r  = objPRIBC.getDepartments(objPRReq);
        DataTable dt = r.GetTable;

        ddl_soc.DataSource     = dt;
        ddl_soc.DataTextField  = "Department";
        ddl_soc.DataValueField = "DeptID";
        ddl_soc.DataBind();
        ddl_soc.Items.Insert(0, "--Select Center--");
    }
    public void getAllItemsinInventory()
    {
        objPRReq.OID = oid;
        PRResp    r  = objPRIBC.getAllItemInventoryNotAbandoned(objPRReq);
        DataTable dt = r.GetTable;

        if (dt.Rows.Count > 0)
        {
            dt.DefaultView.Sort           = "SerialNo Asc";
            rptr_InventoryData.DataSource = dt;
            rptr_InventoryData.DataBind();
        }
    }
    public void getAllManufacturers()
    {
        objPRReq.Status = "Active";
        objPRReq.OID    = oid;
        PRResp    r  = objPRIBC.getAllManufacturers(objPRReq);
        DataTable dt = r.GetTable;

        dt.DefaultView.Sort             = "Name asc";
        ddl_manufacturer.DataSource     = dt;
        ddl_manufacturer.DataTextField  = "Name";
        ddl_manufacturer.DataValueField = "Name";
        ddl_manufacturer.DataBind();
        ddl_manufacturer.Items.Insert(0, "--Select Manufacturer--");
    }
    public void Update()
    {
        objPRReq.ITID   = int.Parse(Request.QueryString["st"].ToString());
        objPRReq.OID    = oid;
        objPRReq.Status = "Active";
        PRResp    r  = objPRIBC.getItemTypeByOID(objPRReq);
        DataTable dt = r.GetTable;

        if (dt.Rows.Count > 0)
        {
            txt_ItemType.Text = dt.Rows[0]["ItemType"].ToString();
            btn_Submit.Text   = "Update";
        }
    }
    public void Update()
    {
        objPRReq.ID     = int.Parse(Request.QueryString["st"].ToString());
        objPRReq.Status = "Active";
        PRResp    r  = objPRIBC.getModelByMID(objPRReq);
        DataTable dt = r.GetTable;

        if (dt.Rows.Count > 0)
        {
            ddl_manufacturer.SelectedValue = dt.Rows[0]["Manufacturer"].ToString();
            txt_model.Text  = dt.Rows[0]["Model"].ToString();
            btn_Submit.Text = "Update";
        }
    }
 protected void final_Click(object sender, EventArgs e)
 {
     try
     {
         HttpFileCollection uploadfile = Request.Files;
         string             p1         = Server.MapPath("..\\Disposed\\");
         if (dispose.HasFile)
         {
             strFileName = DateTime.Now.ToFileTime() + "_" + dispose.FileName.ToString();
             dispose.SaveAs(p1 + strFileName);
         }
         if (rptr_del.Items.Count < 1)
         {
             throw new Exception("Please choose an asset to dispose");
         }
         if (remarks.Text.Length < 1)
         {
             throw new Exception("Please enter a remark");
         }
         if (sale.Text.Length > 0)
         {
             try
             {
                 objPRReq.APrice = double.Parse(sale.Text);
             }
             catch
             {
                 throw new Exception("Enter only numeric digits in Sale price field");
             }
         }
         objPRReq.Remarks  = remarks.Text.Trim();
         objPRReq.FileName = strFileName;
         objPRReq.Status   = "Abandoned";
         objPRReq.OID      = 1;
         foreach (RepeaterItem i in rptr_del.Items)
         {
             string iid = (i.FindControl("iid") as HiddenField).Value;
             objPRReq.IID = int.Parse(iid);
             PRResp r = objPRIBC.EditItemInventoryDisposal(objPRReq);
         }
         string m = "Status of " + rptr_del.Items.Count + " assets successfully changed to abandoned.";
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('" + m.ToString() + "'); window.open('../CIT_DelInv/{0}','_self');", true);
     }
     catch (Exception ex)
     {
         string msg = ex.Message.Replace("'", ""); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert...!!!", "alert('" + msg.ToString() + "');", true);
         return;
     }
 }
Exemple #25
0
    public void Update()
    {
        objPRReq.IID = int.Parse(hdn_IID.Value);
        objPRReq.OID = oid;
        PRResp    r  = objPRIBC.getItemInventory_IID(objPRReq);
        DataTable dt = r.GetTable;

        if (dt.Rows.Count > 0)
        {
            ddl_ItemType.SelectedIndex = int.Parse(dt.Rows[0]["ITID"].ToString());
            string ItemType = dt.Rows[0]["ItemType"].ToString();
            if (ItemType == "New")
            {
                ddl_NewOld.SelectedIndex = 1;
            }
            else
            {
                ddl_NewOld.SelectedIndex = 2;
            }
            ddl_Manufacturer.SelectedValue = dt.Rows[0]["Manufacturer"].ToString().Trim().ToUpper();
            getModels();
            ddl_Model.SelectedValue  = dt.Rows[0]["Model"].ToString().Trim().ToUpper();
            txt_ComputerNo.Text      = dt.Rows[0]["ComputerNumber"].ToString();
            txt_SerialNo.Text        = dt.Rows[0]["SerialNo"].ToString();
            txt_PurchaseDate.Text    = dt.Rows[0]["DOP"].ToString();
            txt_Vendor.Text          = dt.Rows[0]["Vendor"].ToString();
            txt_WarrantyDate.Text    = dt.Rows[0]["WarrantyDate"].ToString();
            ddl_status.SelectedValue = dt.Rows[0]["Status"].ToString();
            efile.Text            = dt.Rows[0]["eFile"].ToString();
            price.Text            = dt.Rows[0]["Price"].ToString();
            bill.Text             = dt.Rows[0]["Bill"].ToString();
            ddl_soc.SelectedValue = dt.Rows[0]["SectionofCenter"].ToString();
            string warranty = dt.Rows[0]["Warranty"].ToString();
            if (warranty == "Warranty")
            {
                ddl_Warranty.SelectedIndex = 1;
            }
            else if (warranty == "AMC")
            {
                ddl_Warranty.SelectedIndex = 2;
            }
            else
            {
                ddl_Warranty.SelectedIndex = 3;
            }
            btn_Submit.Text = "Update";
        }
    }
Exemple #26
0
    public void getEmpType()
    {
        objPRReq.OID    = oid;
        objPRReq.Status = "Active";
        PRResp    r  = objPRIBC.getEmpGroups(objPRReq);
        DataTable dt = r.GetTable;

        if (dt.Rows.Count > 0)
        {
            ddl_EmpType.DataSource     = dt;
            ddl_EmpType.DataTextField  = "EmpGroup";
            ddl_EmpType.DataValueField = "EmpGroup";
            ddl_EmpType.DataBind();
            ddl_EmpType.Items.Insert(0, "--Select EmpType--");
        }
    }
Exemple #27
0
    public void getItemTypes()
    {
        objPRReq.Status = "Active";
        objPRReq.OID    = oid;
        PRResp    r  = objPRIBC.getItemTypes(objPRReq);
        DataTable dt = r.GetTable;

        if (dt.Rows.Count > 0)
        {
            ddl_ItemTypes.DataSource     = dt;
            ddl_ItemTypes.DataTextField  = "ItemType";
            ddl_ItemTypes.DataValueField = "ITID";
            ddl_ItemTypes.DataBind();
            ddl_ItemTypes.Items.Insert(0, "Select Type");
        }
    }
Exemple #28
0
 public void getEmpNames()
 {
     if (ddl_EmpType.SelectedIndex > 0)
     {
         objPRReq.EmpGroup = ddl_EmpType.SelectedItem.Text.Trim();
         objPRReq.OID      = oid;
         objPRReq.Status   = "Active";
         if (ddl_EmpType.SelectedItem.Text != "Project Staff" && ddl_EmpType.SelectedItem.Text != "Others")
         {
             PRResp    r  = objPRIBC.SearchEmpNamebyGroup(objPRReq);
             DataTable dt = r.GetTable;
             if (dt.Rows.Count > 0)
             {
                 ddl_EmpName.DataSource     = dt;
                 ddl_EmpName.DataTextField  = "Name";
                 ddl_EmpName.DataValueField = "EmpID";
                 ddl_EmpName.DataBind();
                 ddl_EmpName.Items.Insert(0, "--EmpName--");
             }
             else
             {
                 ddl_EmpName.Items.Insert(0, "--No Data Found--");
                 ddl_EmpName.DataBind();
             }
         }
         else if (ddl_EmpType.SelectedItem.Text == "Project Staff")
         {
             PRResp    r  = objPRIBC.SearchPSEmpDetails_EmpID(objPRReq);
             DataTable dt = r.GetTable;
             if (dt.Rows.Count > 0)
             {
                 ddl_EmpName.DataSource     = dt;
                 ddl_EmpName.DataTextField  = "Name";
                 ddl_EmpName.DataValueField = "EmpID";
                 ddl_EmpName.DataBind();
                 ddl_EmpName.Items.Insert(0, "--EmpName--");
             }
             else
             {
                 ddl_EmpName.Items.Insert(0, "--No Data Found--");
                 ddl_EmpName.DataBind();
             }
         }
     }
 }
 public void getModels()
 {
     if (ddl_manufacturer.SelectedIndex > 0)
     {
         objPRReq.Manufacturer = ddl_manufacturer.SelectedItem.Text;
         PRResp    r  = objPRIBC.getModelByManufacturer(objPRReq);
         DataTable dt = r.GetTable;
         rptr_Data.DataSource = dt;
         rptr_Data.DataBind();
         manufacturer.Text = objPRReq.Manufacturer + "'s ";
     }
     else
     {
         rptr_Data.DataSource = null;
         rptr_Data.DataBind();
         manufacturer.Text = "";
     }
 }
Exemple #30
0
 public void getModels()
 {
     if (ddl_Manufacturer.SelectedIndex > 0)
     {
         objPRReq.Manufacturer = ddl_Manufacturer.SelectedItem.Text;
         PRResp    r  = objPRIBC.getModelByManufacturer(objPRReq);
         DataTable dt = r.GetTable;
         ddl_Model.DataSource     = dt;
         ddl_Model.DataTextField  = "Model";
         ddl_Model.DataValueField = "Model";
         ddl_Model.DataBind();
         ddl_Model.Items.Insert(0, "--Select Model--");
     }
     else
     {
         ddl_Model.DataSource = null;
         ddl_Model.DataBind();
     }
 }