Beispiel #1
0
    /// <summary>
    /// Delete the Items Category From the List
    /// </summary>
    protected void onDelete(object sender, EventArgs e)                                                         // Delete Button Click
    {
        ImageButton ibtn = (ImageButton)sender;

        string[] deleteCmd = ibtn.CommandArgument.ToString().Split(',');
        if (Convert.ToBoolean(Convert.ToInt32(deleteCmd[1])))
        {
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", "alert('This category is in use - are you sure you want to remove it?');", true);
        }
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            int count = objTechService.PURC_INS_UPD_ItemCategory(TxtCatName.Text, ddlcatType.SelectedItem.Text, null, deleteCmd[0], GetSessionUserID().ToString(), 1);

            BindrgdItmCat();
        }
    }
    public void BindSubCatalogue()
    {
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DataTable dtSubSystem = new DataTable();
            string    CatalogId   = Request.QueryString["Catalogue"];
            dtSubSystem = objTechService.SelectSubCatalogs();

            dtSubSystem.DefaultView.RowFilter = "System_Code ='" + CatalogId + "' or SubSystem_code='0'";
            ddlSubCatalogue.DataTextField     = "Subsystem_Description";
            ddlSubCatalogue.DataValueField    = "SubSystem_code";
            ddlSubCatalogue.DataSource        = dtSubSystem.DefaultView;
            ddlSubCatalogue.DataBind();
            ddlSubCatalogue.Items.FindByText("ALL").Selected = true;
        }
    }
Beispiel #3
0
 protected void BindLineTypeDLL()
 {
     try
     {
         using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
         {
             ddlLinetype.DataSource     = objTechService.GetREQStatus();
             ddlLinetype.DataTextField  = "Description";
             ddlLinetype.DataValueField = "short_code";
             ddlLinetype.DataBind();
         }
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #4
0
    public int PURC_Get_AutoRequision(int Company_Code)
    {
        using (BLL_PURC_Purchase objBl = new BLL_PURC_Purchase())
        {
            DataTable dt = objBl.GET_AUTOMATIC_REQUISTION(Company_Code);

            if (dt.Rows.Count > 0)
            {
                return(Convert.ToInt32(dt.Rows[0]["Is_Auto_Requisition"]));
            }
            else
            {
                return(0);
            }
        }
    }
Beispiel #5
0
    protected void SaveInventryItem(string ItemID)
    {
        BLL_PURC_Purchase objTechService  = new BLL_PURC_Purchase();
        IventoryItemData  objDoInventory1 = new IventoryItemData();

        objDoInventory1.VesselCode      = ViewState["VesselID"].ToString();
        objDoInventory1.RequisitionCode = null;

        objDoInventory1.ItemRefCode   = ItemID.ToString();
        objDoInventory1.ItemInternRef = ItemID.ToString();
        objDoInventory1.SystemCode    = Convert.ToString(GetCatalogue());
        objDoInventory1.SubSystemCode = Convert.ToString(GetSubCatalogue());



        if (txtItemDescription.Text != "")
        {
            objDoInventory1.itemFullDesc = txtItemDescription.Text.Trim();
        }
        else
        {
            objDoInventory1.itemFullDesc = "0";
        }

        objDoInventory1.itemShortDesc      = txtItemName.Text.Trim();
        objDoInventory1.SavedLine          = "5";
        objDoInventory1.RequisitionComment = "0";
        if (txtItemDrawingNumber.Text != "")
        {
            objDoInventory1.Drawing_Number = txtItemDrawingNumber.Text.Trim();
        }
        else
        {
            objDoInventory1.Drawing_Number = "0";
        }

        objDoInventory1.DrawingLink = "1";

        objDoInventory1.CreatedBy = Session["userid"].ToString();

        objDoInventory1.DocumentCode = GetDocumentCode().ToString();
        objDoInventory1.reqestedQty  = "0";
        objDoInventory1.ItemComment  = null;
        objDoInventory1.ROB          = "0";

        int retval = objTechService.SaveInventroySupplyItem(objDoInventory1);
    }
    protected void ddlDepartment_OnSelectedIndexChanged(object source, System.EventArgs e)
    {
        try
        {
            string filter = null;
            string DeptType = rbtnDeptType.SelectedValue.Equals("ALL") ? "0" : rbtnDeptType.SelectedValue;
            DataTable dtCatalog = BLL_PURC_Purchase.Get_Catalogues(UDFLib.ConvertStringToNull(DeptType), UDFLib.ConvertStringToNull(ddlDepartment.SelectedValue));

            StringBuilder sbFilterFlt = new StringBuilder();

            if (DDLVessel.SelectedValues.Rows.Count > 0 && !rbtnDeptType.SelectedValue.Equals("ST"))
            {
                foreach (DataRow dr in DDLVessel.SelectedValues.Rows)
                {
                    sbFilterFlt.Append(dr[0]);
                    sbFilterFlt.Append(",");
                }

                if (sbFilterFlt.Length > 1)
                {
                    sbFilterFlt.Remove(sbFilterFlt.Length - 1, 1);
                    filter = string.Format(" Vessel_Code in (" + sbFilterFlt.ToString() + ")");
                }

                dtCatalog.DefaultView.RowFilter = filter;

            }

            if (dtCatalog.DefaultView.Count > 0)
            {
                ddlCatalogue.Items.Clear();
                ddlCatalogue.DataTextField = "system_description";
                ddlCatalogue.DataValueField = "system_code";
                ddlCatalogue.DataSource = dtCatalog.DefaultView.ToTable();
                ddlCatalogue.DataBind();
                ListItem li = new ListItem("SELECT ALL", "0");
                ddlCatalogue.Items.Insert(0, li);

            }

        }

        catch (Exception ex)
        {

        }
    }
    /// <summary>
    /// Bind the requisition Items list
    /// Disable Withhod Tax and VAT Dropdown if It is nonConfigurable ()
    /// </summary>
    private void BindItmPreviewRpt()                                                                  // Bind requisition Subcatalogue Repeater (Main Grid)
    {
        try
        {
            DataTable distinctValues;
            using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
            {
                dataforDisplay = objTechService.GetReqItemsPreview(ReqsnCode, VesselCode, DocCode);
            }
            if (dataforDisplay.Tables[0].Rows.Count <= 0)
            {
                String msg = String.Format("alert('This Requisition has been finalized or Deleted.');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
            }
            else
            {
                DataView view = new DataView(dataforDisplay.Tables[0]);
                distinctValues     = view.ToTable(true, "SubCatalog", "SubCatalogID");
                rptMain.DataSource = distinctValues;
                rptMain.DataBind();
            }

            for (int i = 0; i < dataforDisplay.Tables[3].Rows.Count; i++)
            {
                if (dataforDisplay.Tables[3].Rows[i]["Property_ID"].ToString() == "1")
                {
                    ddlVAt.Enabled = true;
                }
                else
                {
                    ddlVAt.Enabled = false;
                }
                if (dataforDisplay.Tables[3].Rows[i]["Property_ID"].ToString() == "2")
                {
                    ddlWithHoldTax.Enabled = true;
                }
                else
                {
                    ddlWithHoldTax.Enabled = false;
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    //-- Functions
    /// <summary>
    /// bind the Supplier Gridview and all the detalis initially saved against supplier if the supplier's status is "Approved"
    /// </summary>
    private void BindSupplierView()                                                                   //-- Bind Supplier List
    {
        try
        {
            DataSet   dataforDisplay = new DataSet();
            DataTable dtvat          = BLL_PURC_Common.PURC_Get_Sys_Variable(UDFLib.ConvertToInteger(GetSessionUserID()), "VAT");
            DataTable dtWithHold     = BLL_PURC_Common.PURC_Get_Sys_Variable(UDFLib.ConvertToInteger(GetSessionUserID()), "WIthHoldTax");
            Item_bindddl(ddlVAt, dtvat, null);
            Item_bindddl(ddlWithHoldTax, dtWithHold, null);
            using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
            {
                dataforDisplay = objTechService.ConfiguredSupplierPreview(DocCode, VesselCode, txt_searchCodeName.Text);
            }
            if ((dataforDisplay.Tables[1].Rows.Count > 0 && txt_searchCodeName.Text.Length > 0) || (dataforDisplay.Tables[1].Rows.Count > 0 && dataforDisplay.Tables[1].Rows[0][0].ToString().Length < 3) || (dataforDisplay.Tables[1].Rows.Count < 1))
            {
                GV_SupplierList.DataSource = dataforDisplay.Tables[0];
                GV_SupplierList.DataBind();
                HD_SelectedSupplier.Value = dataforDisplay.Tables[1].Rows[0]["Supplier_Code"].ToString();
                bindSupp_port();
                ddlSupp_Port.SelectedValue = dataforDisplay.Tables[1].Rows[0]["DELIVERY_PORT"].ToString();
                txt_SuppDate.Text          = UDFLib.ConvertUserDateFormat(dataforDisplay.Tables[1].Rows[0]["DELIVERY_DATE"].ToString().Length > 8 ? dataforDisplay.Tables[1].Rows[0]["DELIVERY_DATE"].ToString().Remove(10) : "");
                txt_Discount.Text          = dataforDisplay.Tables[1].Rows[0]["DISCOUNT"].ToString().Split('.')[0];
                txt_Advance.Text           = dataforDisplay.Tables[1].Rows[0]["Advance_Payment"].ToString().Split('.')[0];
            }

            else
            {
                GV_SupplierList.DataSource = dataforDisplay.Tables[1];
                GV_SupplierList.DataBind();
                //CheckBox rbtn = (CheckBox)GV_SupplierList.Rows[0].FindControl("rbtn_suppselect");
                //rbtn.Checked = true;
                GV_SupplierList.Rows[0].BackColor = System.Drawing.Color.SkyBlue;
                HD_SelectedSupplier.Value         = dataforDisplay.Tables[1].Rows[0]["Supplier_Code"].ToString();
                bindSupp_port();
                ddlSupp_Port.SelectedValue   = dataforDisplay.Tables[1].Rows[0]["DELIVERY_PORT"].ToString();
                txt_SuppDate.Text            = UDFLib.ConvertUserDateFormat(dataforDisplay.Tables[1].Rows[0]["DELIVERY_DATE"].ToString().Length > 8 ? dataforDisplay.Tables[1].Rows[0]["DELIVERY_DATE"].ToString().Remove(10) : "");
                txt_Discount.Text            = dataforDisplay.Tables[1].Rows[0]["DISCOUNT"].ToString().Split('.')[0];
                txt_Advance.Text             = dataforDisplay.Tables[1].Rows[0]["Advance_Payment"].ToString().Split('.')[0];
                ddlVAt.SelectedValue         = dataforDisplay.Tables[1].Rows[0]["VAT_Rate"].ToString().Length != null ? dataforDisplay.Tables[1].Rows[0]["VAT_Rate"].ToString() : "0";
                ddlWithHoldTax.SelectedValue = dataforDisplay.Tables[1].Rows[0]["Withholding_Tax_Rate"].ToString() != null ? dataforDisplay.Tables[1].Rows[0]["Withholding_Tax_Rate"].ToString() : "0";
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Beispiel #9
0
    protected void cmbDept_OnSelectedIndexChanged(object source, System.EventArgs e)
    {
        try
        {
            string filter;


            using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
            {
                DataTable dtCatalog = objTechService.SelectCatalog();



                string department = cmbDept.SelectedValue.ToString();

                filter = "1=1";

                if (department != "0")
                {
                    filter += "  and  id='" + department + "'";
                }


                dtCatalog.DefaultView.RowFilter = filter;

                if (dtCatalog.DefaultView.Count > 0)
                {
                    ddlCatalogue.Items.Clear();
                    ddlCatalogue.DataTextField  = "system_description";
                    ddlCatalogue.DataValueField = "system_code";
                    ddlCatalogue.DataSource     = dtCatalog.DefaultView.ToTable();
                    ddlCatalogue.DataBind();
                    ListItem li = new ListItem("SELECT", "0");
                    ddlCatalogue.Items.Insert(0, li);
                }
                else
                {
                }
            }
        }
        catch (Exception ex)
        {
        }
        finally
        {
        }
    }
    protected void grdVessel_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        try
        {
            using (BLL_PURC_Purchase objTechService = new  BLL_PURC_Purchase())
            {
                DataTable dtvessel = new DataTable();
                dtvessel = objTechService.GetVesselName();

                if (fleet.SelectedIndex == 0)
                {
                    grdVessel.DataSource = dtvessel;
                }
                else
                {
                    dtvessel.DefaultView.RowFilter = "Fleet like '" + fleet.SelectedItem.Text + "%' ";
                    grdVessel.DataSource           = dtvessel.DefaultView;
                }
                grdVessel.DataSource = dtvessel;
            }
        }
        catch (Exception ex)
        {
            //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
        }
        finally
        {
        }



        //PMSClass.clsVessels vessel = new PMSClass.clsVessels();
        //vessel.Constring = _constring;
        //DataTable dtvessel = new DataTable();
        //dtvessel = vessel.GetVesselName();
        //if (fleet.SelectedIndex == 0)
        //{
        //    grdVessel.DataSource = dtvessel;
        //}
        //else
        //{
        //    dtvessel.DefaultView.RowFilter = "Fleet like '" + fleet.SelectedItem.Text + "%' ";
        //    grdVessel.DataSource = dtvessel.DefaultView;
        //}
        //grdVessel.DataSource = dtvessel;
    }
    private void bindVesselDDL()
    {
        try
        {
            //using ( BLL_PURC_Purchase  objTechService = new  BLL_PURC_Purchase ())
            //{

            //    DataTable dtvessel = new DataTable();
            //    dtvessel = objTechService.SelectFleet();
            //    fleet.DataTextField = "Name";
            //    fleet.DataValueField = "Code";
            //    fleet.AppendDataBoundItems = true;
            //    fleet.DataSource = dtvessel;
            //    fleet.DataBind();

            //
            //}


            using (BLL_PURC_Purchase objTechService = new  BLL_PURC_Purchase())
            {
                DataSet FleetDS = objTechService.SelectFleet();
                fleet.DataSource     = FleetDS.Tables[0];
                fleet.DataTextField  = "Name";
                fleet.DataValueField = "Code";
                fleet.DataBind();
            }
        }
        catch (Exception ex)
        {
            //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
        }
        finally
        {
        }

        //PMSClass.clsVessels vessel = new PMSClass.clsVessels();
        //vessel.Constring = _constring;
        //DataTable dtvessel = new DataTable();
        //dtvessel = vessel.GetFleet();
        //fleet.DataTextField = "Fleet";
        //fleet.DataValueField = "Fleet";
        //fleet.AppendDataBoundItems = true;
        //fleet.DataSource = dtvessel;
        //fleet.DataBind();
    }
    protected void ImgAssignCatalog_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            string cell  = "1";
            string cell1 = "1";

            using (BLL_PURC_Purchase objTechService = new  BLL_PURC_Purchase())
            {
                foreach (GridDataItem selectedItem1 in grdVessel.SelectedItems)
                {
                    GridDataItem row1 = (GridDataItem)selectedItem1;// to access the selected row
                    cell1 = row1["Vessel_code"].Text;

                    foreach (GridDataItem selectedItem in grdAssignLocation.SelectedItems)
                    {
                        GridDataItem row = (GridDataItem)selectedItem;// to access the selected row
                        cell = row["code"].Text;
                        foreach (GridDataItem item in grdunAsigncatalog.SelectedItems)
                        {
                            AssignVesselData objAssignVesselDataDO = new AssignVesselData();

                            GridDataItem rowItem  = (GridDataItem)item;// to access the selected row
                            string       cellItem = rowItem["system_Code"].Text;
                            objAssignVesselDataDO.Vessel_code      = cell1;
                            objAssignVesselDataDO.LocationCode     = cell;
                            objAssignVesselDataDO.Systemcode       = cellItem;
                            objAssignVesselDataDO.LocationComments = "";
                            objAssignVesselDataDO.CurrentUser      = Session["user"].ToString();
                            int a = objTechService.VLassignLocation(objAssignVesselDataDO);
                        }
                    }
                }
                bindCatalogLocation(cell, cell1);
            }

            //AddToSyncronizer.AddToSyncroNizerData("PURC_Dtl_Vessel_Locations");
        }
        catch (Exception ex)
        {
            //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
        }
        finally
        {
        }
    }
 public void BindDeptType()
 {
     try
     {
         using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
         {
             DataTable DeptDt = objTechService.GetDeptType();
             optList.DataSource     = DeptDt;
             optList.DataTextField  = "Description";
             optList.DataValueField = "Short_Code";
             optList.DataBind();
         }
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #14
0
    private void BindApprovers()
    {
        BLL_PURC_Purchase objPurcBLL = new BLL_PURC_Purchase();

        try
        {
            DataTable dt = objPurcBLL.GetApproverList("");
            cmdApprover.DataSource     = dt;
            cmdApprover.DataTextField  = "UserName";
            cmdApprover.DataValueField = "UserID";
            cmdApprover.DataBind();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Beispiel #15
0
    //private void BindRequisitionStatus(string sRequiPendingType)
    //{

    //    using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
    //    {
    //        DataTable dtREQStatus = objTechService.GetREQStatus();
    //        DataRow[] filterRows = dtREQStatus.Select("short_code ='" + sRequiPendingType + "'");
    //        dtREQStatus.DefaultView.RowFilter = "code < '" + filterRows[0][0].ToString() + "'";

    //        DDLReqStages.DataSource = dtREQStatus.DefaultView;
    //        DDLReqStages.DataTextField = "Description";
    //        DDLReqStages.DataValueField = "short_code";
    //        DDLReqStages.DataBind();


    //    }
    //}

    private void ColourForReSendforQtn()
    {
        DataTable dtRFQReQtn = new DataTable();

        foreach (GridDataItem dataItem in rgdEval.MasterTableView.Items)
        {
            using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
            {
                dtRFQReQtn = objTechService.CountRFQSendForReQuotation(dataItem["REQUISITION_CODE"].Text.ToString(), dataItem["Vessel_Code"].Text.ToString(), dataItem["document_code"].Text.ToString());
                int ReQtnCount = Convert.ToInt32(dtRFQReQtn.Rows[0]["ReSendForQtn"].ToString());
                if (ReQtnCount >= 1)
                {
                    dataItem.BackColor = System.Drawing.Color.LightGreen;
                }
            }
        }
    }
Beispiel #16
0
    public void BindPayDetailsGrid()
    {
        try
        {
            string        catalogId   = "";
            string        Vessel_Code = "";
            StringBuilder filter      = new StringBuilder();
            filter.Append("1=1");

            filter.Append(" and Delivery_Date >='" + txtfrom.Text.Trim() + "'  and Delivery_Date <='" + txtto.Text.Trim() + "'");

            if (cmbDept.SelectedIndex > 0)
            {
                filter.Append(" and Department='" + cmbDept.SelectedValue.ToString() + "'");
            }
            if (optList.SelectedItem.Text != "ALL")
            {
                filter.Append(" and Form_Type='" + optList.SelectedItem.Value.ToString() + "'");
            }

            if (cmbCatalog.SelectedItem.Text != "ALL" && cmbCatalog.SelectedIndex > 0)
            {
                catalogId = cmbCatalog.SelectedValue.ToString();
            }
            if (DDLVessel.SelectedItem.Text != "ALL" && DDLVessel.SelectedIndex > 0)
            {
                Vessel_Code = DDLVessel.SelectedValue.ToString();
            }

            using (BLL_PURC_Purchase objTechService = new  BLL_PURC_Purchase())
            {
                DataTable dtPayDetails = new DataTable();
                //need to pass the date as parameters..
                dtPayDetails = objTechService.SelectPayDetailsOnDeliveredItems(txtfrom.Text.Substring(6, 4) + "/" + txtfrom.Text.Substring(3, 2) + "/" + txtfrom.Text.Substring(0, 2), txtto.Text.Substring(6, 4) + "/" + txtto.Text.Substring(3, 2) + "/" + txtto.Text.Substring(0, 2), catalogId, Vessel_Code);
                dtPayDetails.DefaultView.RowFilter = filter.ToString();
                rgdPayDetails.DataSource           = dtPayDetails.DefaultView;
                rgdPayDetails.DataBind();
            }
        }
        catch //(Exception ex)
        {
        }
        finally
        {
        }
    }
    public void imgbtnDelete_Click(object s, EventArgs e)
    {
        try
        {
            BLL_PURC_Purchase objAttch = new BLL_PURC_Purchase();

            int ID  = int.Parse(((ImageButton)s).CommandArgument.Split(new char[] { ',' })[0]);
            int res = objAttch.Purc_Delete_Reqsn_Attachments(ID);
            if (res > 0)
            {
                File.Delete(Server.MapPath(((ImageButton)s).CommandArgument.Split(new char[] { ',' })[1]));
                BindAttchmentInfo();
            }
        }
        catch
        { }
    }
    protected void rbtnDeptType_SelectedIndexChanged(object sender, EventArgs e)
    {

        try
        {
            using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
            {
                DataTable dtDepartment = new DataTable();
                dtDepartment = objTechService.SelectDepartment();

                if (rbtnDeptType.SelectedItem.Text == "Spares")
                {
                    dtDepartment.DefaultView.RowFilter = "Form_Type='" + rbtnDeptType.SelectedValue + "'";


                }
                else if (rbtnDeptType.SelectedItem.Text == "Stores")
                {
                    dtDepartment.DefaultView.RowFilter = "Form_Type='" + rbtnDeptType.SelectedValue + "'";



                }
                else if (rbtnDeptType.SelectedItem.Text == "Repairs")
                {
                    dtDepartment.DefaultView.RowFilter = "Form_Type='" + rbtnDeptType.SelectedValue + "'";


                }
                ddlDepartment.Items.Clear();
                ddlDepartment.DataTextField = "Name_Dept";
                ddlDepartment.DataValueField = "Code";
                ddlDepartment.DataSource = dtDepartment;
                ddlDepartment.DataBind();
                ListItem li = new ListItem("SELECT ALL", "0");
                ddlDepartment.Items.Insert(0, li);

            }

        }
        catch (Exception ex)
        {

        }

    }
    /// <summary>
    /// For binding location using parent type & search keyword
    /// </summary>
    private void BindLocation()
    {
        try
        {
            BLL_PURC_Purchase objBLLPURC = new BLL_PURC_Purchase();
            DataTable         dtlocation = objBLLPURC.LibraryGetSystemParameterList("1", "");

            ddllocation.DataTextField  = "DESCRIPTION";
            ddllocation.DataValueField = "CODE";
            ddllocation.DataSource     = dtlocation;
            ddllocation.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void BindSubCatalogue(string CatalogId)
    {
        try
        {
            using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
            {
                BindSubCataLogs(CatalogId);

                ViewState["countPerRenderPage"] = "0";
                ViewState["countTotalRec"]      = "0";
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    protected void ddlCatalogue_SelectedIndexChanged(object sender, EventArgs e)
    {
        ((DataTable)ViewState["vsdtSelected_Items"]).Clear();
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DataTable dtSubSystem = new DataTable();
            string    CatalogId   = ddlCatalogue.SelectedValue;
            dtSubSystem = objTechService.SelectSubCatalogs();

            dtSubSystem.DefaultView.RowFilter = "System_Code ='" + CatalogId + "' or SubSystem_code='0'";
            ddlSubCatalogue.DataTextField     = "Subsystem_Description";
            ddlSubCatalogue.DataValueField    = "SubSystem_code";
            ddlSubCatalogue.DataSource        = dtSubSystem.DefaultView;
            ddlSubCatalogue.DataBind();
            ddlSubCatalogue.Items.FindByText("ALL").Selected = true;
        }
    }
Beispiel #22
0
    private void ShowSupplierDetails()
    {
        try
        {
            DataTable dtSupplierData = new DataTable();
            using (BLL_PURC_Purchase objTechService = new  BLL_PURC_Purchase())
            {
                dtSupplierData = objTechService.ViewSupplierDetails(Request.QueryString["SupplierCode"].ToString());


                txtSupplierCode.Text     = Convert.ToString(dtSupplierData.Rows[0]["Supplier"]);
                txtSupplierName.Text     = Convert.ToString(dtSupplierData.Rows[0]["Short_Name"]);
                txtSupplierType.Text     = Convert.ToString(dtSupplierData.Rows[0]["Supplier_Type"]);
                txtFullName.Text         = Convert.ToString(dtSupplierData.Rows[0]["Full_Name"]);
                txtSupplierCategory.Text = Convert.ToString(dtSupplierData.Rows[0]["Supplier_Category"]);
                txtCompanyType.Text      = Convert.ToString(dtSupplierData.Rows[0]["COMPANY_TYPE"]);
                txtCompanyStatus.Text    = Convert.ToString(dtSupplierData.Rows[0]["COMPANY_STATUS"]);
                txtCompanyCurrency.Text  = Convert.ToString(dtSupplierData.Rows[0]["CURRENCY"]);

                txtAddress1.Text = Convert.ToString(dtSupplierData.Rows[0]["Address_1"]);
                txtAddress2.Text = Convert.ToString(dtSupplierData.Rows[0]["Address_2"]);
                txtAddress3.Text = Convert.ToString(dtSupplierData.Rows[0]["Address_3"]);
                txtAddress4.Text = Convert.ToString(dtSupplierData.Rows[0]["Address_4"]);
                txtAddress5.Text = Convert.ToString(dtSupplierData.Rows[0]["Address_5"]);

                txtCity.Text      = Convert.ToString(dtSupplierData.Rows[0]["City"]);
                txtCountry.Text   = Convert.ToString(dtSupplierData.Rows[0]["Country"]);
                txtPostal.Text    = Convert.ToString(dtSupplierData.Rows[0]["Postal_Code"]);
                txtPhone.Text     = Convert.ToString(dtSupplierData.Rows[0]["MakerPhone"]);
                txtExtension.Text = Convert.ToString(dtSupplierData.Rows[0]["MakerTELEX"]);
                txtEmail.Text     = Convert.ToString(dtSupplierData.Rows[0]["MakerEmail"]);
                txtFax.Text       = Convert.ToString(dtSupplierData.Rows[0]["MakerFax"]);

                txtBankName.Text      = Convert.ToString(dtSupplierData.Rows[0]["BANK_NAME"]);
                txtBranch.Text        = Convert.ToString(dtSupplierData.Rows[0]["BANK_BRANCH"]);
                txtBankAccNumber.Text = Convert.ToString(dtSupplierData.Rows[0]["BANK_ACCOUNT"]);
                txtBankAddress.Text   = Convert.ToString(dtSupplierData.Rows[0]["BANK_ADDRESS"]);
                txtBankCity.Text      = Convert.ToString(dtSupplierData.Rows[0]["BANK_CITY"]);
                txtBankCountry.Text   = Convert.ToString(dtSupplierData.Rows[0]["BANK_COUNTRY"]);
            }
        }
        catch (Exception ex)
        {
            //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
        }
    }
Beispiel #23
0
    public void btnSendPassword_Click(object s, EventArgs e)
    {
        int    sts = BLL_PURC_Purchase.GET_UPD_SUPPLIER_PASSWORD(txtUserid.Text.Trim());
        String msg = "";

        if (sts == 1)
        {
            txtUserid.Text = "";
            msg            = String.Format("alert('Password will be send on registered email address.');");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "mssucc", msg, true);
        }
        else
        {
            txtUserid.Text = "";
            msg            = String.Format("alert('Please enter correct User ID !');");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "mserr", msg, true);
        }
    }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         int ReturenID;
         using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
         {
             ReturenID = objTechService.DeleteRequisitionItem(ReqsnCode, DocCode);
         }
         String msg = String.Format("alert('Requisition has been deleted sucessfully.'); ");
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
         Response.Redirect("PendingRequisitionDetails.aspx");
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
     }
 }
Beispiel #25
0
    /// <summary>
    /// Tab1 - (Auto Requisition)
    /// Tab2 - (New Rank)
    /// Tab3 - (Configuration Setting)
    /// Tab4 - (Mandatory Fields)
    /// </summary>

    //-- Tab 1
    #region AutoRequisition
    private void SaveAutoRequsition()
    {
        BLL_PURC_Purchase objBLLPurc = new BLL_PURC_Purchase();

        try
        {
            int    Company_ID = Convert.ToInt32(Session["USERCOMPANYID"]);
            int    result     = objBLLPurc.INSERT_AUTOMATIC_REQUISTION(Company_ID, chkAutoReq.Checked, chkSuppConf.Checked);
            string js         = "alert('Purchase Configuration Settings Saved Successfully..');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true);
        }
        catch (Exception ex)
        {
            string js = "alert('Error Occurred..');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true);
            UDFLib.WriteExceptionLog(ex);
        }
    }
Beispiel #26
0
    protected void onDelete(object source, CommandEventArgs e)
    {
        string[] strIds      = e.CommandArgument.ToString().Split(',');
        string   sCode       = strIds[0];
        string   sParentType = strIds[1];

        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            LocationData objLocationDO = new LocationData();

            LocationID         = sCode;
            objLocationDO.Code = sCode;

            objLocationDO.CurrentUser = Session["userid"].ToString();
            int count = objTechService.DeleteLocation(objLocationDO);
            BindrgdFrequency();
        }
    }
Beispiel #27
0
    public void BindFromSubCatalogueDLL()
    {
        using (BLL_PURC_Purchase objBLLPurc = new BLL_PURC_Purchase())
        {
            DataSet ds = objBLLPurc.LibrarySubCatalogueSearch(DDLFromSystem.SelectedValue, "", null, null, null, null, 1, 1000, 1);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DDLFromSubsystem.Items.Clear();
                DDLFromSubsystem.DataSource     = ds.Tables[0];
                DDLFromSubsystem.DataTextField  = "Subsystem_Description";
                DDLFromSubsystem.DataValueField = "ID";
                DDLFromSubsystem.DataBind();
                ListItem li = new ListItem("--SELECT ALL--", "0");
                DDLFromSubsystem.Items.Insert(0, li);
            }
        }
    }
Beispiel #28
0
    private void BindToCatalogueDLL()
    {
        using (BLL_PURC_Purchase objBLLPurc = new BLL_PURC_Purchase())
        {
            DataSet ds = objBLLPurc.LibraryCatalogueSearch(null, txtToMachinery.Text.Trim(), "SP", DDLToDept.SelectedValue, Int32.Parse(DDLToVessel.SelectedValue), "", 1, null, null, 1, 500, 1);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DDLToSystem.Items.Clear();
                DDLToSystem.DataSource     = ds.Tables[0];
                DDLToSystem.DataTextField  = "System_Description";
                DDLToSystem.DataValueField = "System_Code";
                DDLToSystem.DataBind();
                ListItem li = new ListItem("--SELECT ALL--", "0");
                DDLToSystem.Items.Insert(0, li);
            }
        }
    }
    /// <summary>
    /// Binding function
    /// </summary>
    public void Bindcmb_Function()
    {
        try
        {
            BLL_PURC_Purchase objBLLPurc = new BLL_PURC_Purchase();

            DataTable dt = objBLLPurc.LibraryGetSystemParameterList("115", null);

            cmb_Function.DataSource     = dt;
            cmb_Function.DataTextField  = "DESCRIPTION";
            cmb_Function.DataValueField = "CODE";
            cmb_Function.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void ddlCatalogue_OnSelectedIndexChanged(object s, EventArgs e)
    {
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DataTable dtSubSystem = new DataTable();
            string    CatalogId   = ddlCatalogue.SelectedValue;
            dtSubSystem = objTechService.SelectSubCatalogs();

            dtSubSystem.DefaultView.RowFilter = "System_Code ='" + CatalogId + "' or SubSystem_code='0'";
            ddlSubCatalogue.Items.Clear();
            ddlSubCatalogue.DataTextField  = "subsystem_description";
            ddlSubCatalogue.DataValueField = "subsystem_code";
            ddlSubCatalogue.DataSource     = dtSubSystem.DefaultView;
            ddlSubCatalogue.DataBind();
            ListItem li = new ListItem("SELECT ALL", "0");
            ddlSubCatalogue.Items.Insert(0, li);
        }
    }