Beispiel #1
0
    void FillCombos()
    {
        try
        {
            DataTable dtItem = CommonClasses.Execute("SELECT I_NAME,I_CODENO,I_CODE FROM ITEM_MASTER WHERE I_CAT_CODE=-2147483648 AND ES_DELETE=0");

            ddlComponent.DataSource     = dtItem;
            ddlComponent.DataTextField  = "I_CODENO";
            ddlComponent.DataValueField = "I_CODE";
            ddlComponent.DataBind();
            ddlComponent.Items.Insert(0, new ListItem("Select Item Code", "0"));

            ddlItemName.DataSource     = dtItem;
            ddlItemName.DataTextField  = "I_NAME";
            ddlItemName.DataValueField = "I_CODE";
            ddlItemName.DataBind();
            ddlItemName.Items.Insert(0, new ListItem("Select Item Name", "0"));
        }
        catch (Exception)
        {
        }
    }
    bool ModifyLog(string PrimaryKey)
    {
        try
        {
            CheckModifyLog = false;
            DataTable dt = CommonClasses.Execute("select MODIFY from ACCOUNT_LEDGER where L_CODE=" + PrimaryKey + "  ");
            if (dt.Rows.Count > 0)
            {
                if (Convert.ToBoolean(dt.Rows[0][0].ToString()) == true)
                {
                    ShowMessage("#Avisos", "Record used by another user", CommonClasses.MSG_Warning);
                    return(true);
                }
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Account Ledger Master", "ModifyLog", Ex.Message);
        }

        return(false);
    }
    private void LoadTaxHeadSales()
    {
        DataTable dt = new DataTable();

        try
        {
            //BL_EmployeeMaster = new EmployeeMaster_BL();
            //dt = CommonClasses.Execute("select SCT_DESC,SCT_CODE from SECTOR_MASTER where SCT_CM_COMP_ID=" + (string)Session["CompanyId"] + " and ES_DELETE=0 ORDER BY SCT_DESC");
            dt = CommonClasses.Execute("select TALLY_CODE,TALLY_NAME from TALLY_MASTER where TALLY_COMP_ID=" + (string)Session["CompanyId"] + " and ES_DELETE=0");


            ddlTaxAccHeadSales.DataSource     = dt;
            ddlTaxAccHeadSales.DataTextField  = "TALLY_NAME";
            ddlTaxAccHeadSales.DataValueField = "TALLY_CODE";
            ddlTaxAccHeadSales.DataBind();
            ddlTaxAccHeadSales.Items.Insert(0, new ListItem("Select Tax Acc Head for Sales", "0"));

            ddlTaxSales.DataSource     = dt;
            ddlTaxSales.DataTextField  = "TALLY_NAME";
            ddlTaxSales.DataValueField = "TALLY_CODE";
            ddlTaxSales.DataBind();
            ddlTaxSales.Items.Insert(0, new ListItem("Select Tax Acc For Sales", "0"));

            ddlTaxPurchase.DataSource     = dt;
            ddlTaxPurchase.DataTextField  = "TALLY_NAME";
            ddlTaxPurchase.DataValueField = "TALLY_CODE";
            ddlTaxPurchase.DataBind();
            ddlTaxPurchase.Items.Insert(0, new ListItem("Select Tax Acc For Purchase", "0"));
        }
        catch (Exception ex)
        {
            CommonClasses.SendError("Sale Tax Master", "Load Tax Head", ex.Message);
        }
        finally
        {
            //dt.Dispose();
        }
    }
Beispiel #4
0
    bool CheckValid()
    {
        bool flag = false;

        try
        {
            if (ddlType.SelectedIndex == 0)
            {
                flag = false;
            }
            else if (ddlType.SelectedIndex == 1 && ddlMatReqNo.SelectedIndex == 0)
            {
                flag = false;
            }
            else if (ddlItemName.SelectedIndex == 0)
            {
                flag = false;
            }
            else if (txtDepartment.Text == "")
            {
                flag = false;
            }
            else if (dgvPurReqDet.Enabled != true)
            {
                flag = false;
            }
            else
            {
                flag = true;
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Purchase Requisition", "CheckValid", Ex.Message);
        }

        return(flag);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (string.IsNullOrEmpty((string)Session["CompanyId"]) && string.IsNullOrEmpty((string)Session["Username"]))
            {
                Response.Redirect("~/Default.aspx", false);
            }
            else
            {
                if (!IsPostBack)
                {
                    DataTable dtRights = CommonClasses.Execute("select UR_RIGHTS from USER_RIGHT where UR_IS_DELETE=0 AND UR_UM_CODE='" + Convert.ToInt32(Session["UserCode"]) + "' and UR_SM_CODE='105'");
                    right = dtRights.Rows.Count == 0 ? "00000000" : dtRights.Rows[0][0].ToString();

                    dtFilter.Clear();
                    if (dtFilter.Columns.Count == 0)
                    {
                        dtFilter.Columns.Add(new System.Data.DataColumn("FOS_CODE", typeof(string)));
                        dtFilter.Columns.Add(new System.Data.DataColumn("FOS_NO", typeof(string)));
                        dtFilter.Columns.Add(new System.Data.DataColumn("FOS_BATCH_NO", typeof(string)));
                        dtFilter.Columns.Add(new System.Data.DataColumn("FOS_DATE", typeof(string)));
                        //dtFilter.Columns.Add(new System.Data.DataColumn("CUST_NAME", typeof(string)));

                        dtFilter.Rows.Add(dtFilter.NewRow());
                        dgFillOffSheet.DataSource = dtFilter;
                        dgFillOffSheet.DataBind();
                        //dgFillOffSheet.Enabled = false;
                    }
                    LoadFillOffSheet();
                }
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Issue Fill Off Sheet-View", "Page_Load", Ex.Message);
        }
    }
    //#region LoadCurr
    //private void LoadCurr()
    //{
    //    try
    //    {
    //        DataTable dt = CommonClasses.Execute("SELECT CURR_CODE,CURR_NAME FROM CURRANCY_MASTER WHERE ES_DELETE = 0 AND CURR_CM_COMP_ID = " + (string)Session["CompanyId"] + "  ORDER BY CURR_NAME");
    //        ddlLedger.DataSource = dt;
    //        ddlLedger.DataTextField = "CURR_NAME";
    //        ddlLedger.DataValueField = "CURR_CODE";
    //        ddlLedger.DataBind();
    //        ddlLedger.Items.Insert(0, new ListItem("Select Ledger", "0"));
    //        ddlLedger.SelectedIndex = -1;
    //    }
    //    catch (Exception Ex)
    //    {
    //        CommonClasses.SendError("Export PO", "LoadIName", Ex.Message);
    //    }
    //}
    //#endregion

    #region GetValues
    public bool GetValues(string str)
    {
        bool res = false;

        try
        {
            if (str == "VIEW")
            {
                ddlCustomer.SelectedValue = BL_RecieptEntry.RCP_P_CODE.ToString();
                txtRCPno.Text             = BL_RecieptEntry.RCP_NO.ToString();
                txtChequeNo.Text          = BL_RecieptEntry.RCP_CHEQUE_NO.ToString();

                txtRCPDate.Text         = BL_RecieptEntry.RCP_DATE.ToString("dd MMM YYYY");
                txtChequeDate.Text      = BL_RecieptEntry.RCP_CHEQUE_DATE.ToString("dd MMM YYYY");
                ddlLedger.SelectedValue = BL_RecieptEntry.RCP_LEDGER_CODE.ToString();
                txtAmount.Text          = BL_RecieptEntry.RCP_AMOUNT.ToString();
            }
            else if (str == "VIEW")
            {
                ddlCustomer.Enabled = false;
                txtRCPno.Enabled    = false;
                txtChequeNo.Enabled = false;

                txtChequeDate.Enabled = false;
                txtRCPDate.Enabled    = false;
                BtnInsert.Visible     = false;
                btnSubmit.Visible     = false;
                ddlLedger.Enabled     = false;
                txtAmount.Enabled     = false;
            }
            res = true;
        }
        catch (Exception ex)
        {
            CommonClasses.SendError("Reciept Entry", "GetValues", ex.Message);
        }
        return(res);
    }
Beispiel #7
0
    private void LoadCombos()
    {
        try
        {
            DataTable custdet = new DataTable();
            custdet = CommonClasses.Execute(" SELECT DISTINCT P_CODE,P_NAME  FROM CUSTREJECTION_MASTER,PARTY_MASTER where CR_P_CODE =P_CODE AND CUSTREJECTION_MASTER.ES_DELETE=0  and P_CM_COMP_ID=" + Session["CompanyId"].ToString() + "   ORDER BY P_NAME ");
            ddlCustomerName.DataSource     = custdet;
            ddlCustomerName.DataTextField  = "P_NAME";
            ddlCustomerName.DataValueField = "P_CODE";
            ddlCustomerName.DataBind();
            ddlCustomerName.Items.Insert(0, new ListItem("Select Customer", "0"));


            DataTable dtItemDet = new DataTable();
            dtItemDet = CommonClasses.Execute("SELECT DISTINCT I_CODE,I_CODENO,I_NAME   FROM CUSTREJECTION_MASTER,CUSTREJECTION_DETAIL,ITEM_MASTER  where CR_CODE =CD_CR_CODE AND CUSTREJECTION_MASTER.ES_DELETE=0   AND I_CODE=CD_I_CODE  AND  I_CM_COMP_ID=" + (string)Session["CompanyId"] + " and ITEM_MASTER.ES_DELETE=0   ORDER BY I_NAME");

            ddlFinishedComponent.DataSource     = dtItemDet;
            ddlFinishedComponent.DataTextField  = "I_CODENO";
            ddlFinishedComponent.DataValueField = "I_CODE";
            ddlFinishedComponent.DataBind();
            ddlFinishedComponent.Items.Insert(0, new ListItem("Select Item code", "0"));

            ddlItemName.DataSource     = dtItemDet;
            ddlItemName.DataTextField  = "I_NAME";
            ddlItemName.DataValueField = "I_CODE";
            ddlItemName.DataBind();
            ddlItemName.Items.Insert(0, new ListItem("Select Item Name", "0"));


            DataTable dtUserDet = new DataTable();

            dtUserDet = CommonClasses.Execute("select LG_DOC_NO,LG_U_NAME,LG_U_CODE from LOG_MASTER where LG_DOC_NO='Customer Order Master' and LG_CM_COMP_ID=" + (string)Session["CompanyId"] + "  group by LG_DOC_NO,LG_U_NAME,LG_U_CODE ");
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Customer Rejection Register", "LoadCustomer", Ex.Message);
        }
    }
    public bool Delete()
    {
        bool result = false;

        try
        {
            //Update Master Table Flag
            DL_DBAccess = new DatabaseAccessLayer();
            SqlParameter[] par = new SqlParameter[5];
            par[0] = new SqlParameter("@PK_CODE", PAYM_CODE);
            par[1] = new SqlParameter("@PK_Field", "PAYM_CODE");
            par[2] = new SqlParameter("@ES_DELETE", "1");
            par[3] = new SqlParameter("@DELETE", "ES_DELETE");
            par[4] = new SqlParameter("@TABLE_NAME", "PAYMENT_MASTER");
            result = DL_DBAccess.Insertion_Updation_Delete("SP_CM_DELETE", par);

            if (result == true)
            {
                //Delete from stock table
                DataTable stockqty = CommonClasses.Execute("select PAYMD_PAYM_CODE,PAYMD_AMOUNT from PAYMENT_DETAIL,PAYMENT_MASTER where PAYMD_PAYM_CODE=PAYM_CODE AND PAYMD_PAYM_CODE='" + PAYM_CODE + "'");

                for (int k = 0; k < stockqty.Rows.Count; k++)
                {
                    CommonClasses.Execute("Update BILL_PASSING_MASTER set BPM_PAID_AMT=ISNULL(BPM_PAID_AMT,0)-" + stockqty.Rows[k]["PAYMD_AMOUNT"] + " where BPM_CODE='" + stockqty.Rows[k]["PAYMD_INVOICE_CODE"] + "'");
                }
            }

            return(result);
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Payemt Entry", "Delete", Ex.Message);

            return(false);
        }
        finally
        { }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (string.IsNullOrEmpty((string)Session["CompanyId"]) && string.IsNullOrEmpty((string)Session["Username"]))
            {
                Response.Redirect("~/Default.aspx", false);
            }
            else
            {
                if (!IsPostBack)
                {
                    DataTable dtRights = CommonClasses.Execute("select UR_RIGHTS from USER_RIGHT where UR_IS_DELETE=0 AND UR_UM_CODE='" + Convert.ToInt32(Session["UserCode"]) + "' and UR_SM_CODE='66'");
                    right = dtRights.Rows.Count == 0 ? "0000000" : dtRights.Rows[0][0].ToString();
                    LoadTallyDet();
                    if (dgTallySales.Rows.Count == 0)
                    {
                        if (dtFilter.Columns.Count == 0)
                        {
                            dgTallySales.Enabled = false;
                            dtFilter.Columns.Add(new System.Data.DataColumn("TTM_CODE", typeof(String)));
                            dtFilter.Columns.Add(new System.Data.DataColumn("TTM_NO", typeof(String)));
                            dtFilter.Columns.Add(new System.Data.DataColumn("TTM_DATE", typeof(String)));
                            dtFilter.Columns.Add(new System.Data.DataColumn("TTM_ENTRY_TYPE", typeof(String)));

                            dtFilter.Rows.Add(dtFilter.NewRow());
                            dgTallySales.DataSource = dtFilter;
                            dgTallySales.DataBind();
                        }
                    }
                }
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Tally Transfer Purchase", "Page_Load", Ex.Message);
        }
    }
Beispiel #10
0
    private bool CheckValid()
    {
        bool flag = false;

        try
        {
            if (txtWithdrawal.Text.Trim() == "")
            {
                flag = false;
            }
            else if (txtDeposit.Text.Trim() == "")
            {
                flag = false;
            }
            else if (txtRemark.Text.Trim() == "")
            {
                flag = false;
            }
            else if (ddlBank.SelectedIndex == 0)
            {
                flag = false;
            }
            else if (dllLedger.SelectedIndex == 0)
            {
                flag = false;
            }
            else
            {
                flag = true;
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Cash Book Entry", "CheckValid", Ex.Message);
        }

        return(flag);
    }
Beispiel #11
0
    protected void dgAMCDet_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        try
        {
            if (CommonClasses.ValidRights(int.Parse(right.Substring(4, 1)), this, "For Delete"))
            {
                if (!ModifyLog(((Label)(dgAMCDet.Rows[e.RowIndex].FindControl("lblWO_AMC_CODE"))).Text))
                {
                    string WO_AMC_CODE = ((Label)(dgAMCDet.Rows[e.RowIndex].FindControl("lblWO_AMC_CODE"))).Text;

                    bool flag = CommonClasses.Execute1("UPDATE WORK_AMC_ORDER_MASTER SET ES_DELETE = 1 WHERE WO_AMC_CODE='" + Convert.ToInt32(WO_AMC_CODE) + "'");
                    if (flag == true)
                    {
                        CommonClasses.WriteLog("Annual Mainteance Contract", "Delete", "Annual Mainteance Contract", WO_AMC_CODE, Convert.ToInt32(WO_AMC_CODE), Convert.ToInt32(Session["CompanyId"]), Convert.ToInt32(Session["CompanyCode"]), (Session["Username"].ToString()), Convert.ToInt32(Session["UserCode"]));

                        PanelMsg.Visible = true;
                        lblmsg.Text      = "Record deleted successfully";
                        ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);
                    }
                    LoadACDetail();
                }
            }
            else
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "You have no rights to delete";
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);

                //ShowMessage("#Avisos", "You Have No Rights To Delete", CommonClasses.MSG_Erro);
                return;
            }
        }

        catch (Exception Ex)
        {
            CommonClasses.SendError("AMC Transaction", "dgDetailPO_RowDeleting", Ex.Message);
        }
    }
Beispiel #12
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            if (ddlCustomer.SelectedIndex == 0)
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "Select Customer Name";
                // ShowMessage("#Avisos", "", CommonClasses.MSG_Warning);
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);

                //PanelMsg.Visible = true;
                //lblmsg.Text = "Select Customer Name";
                ddlCustomer.Focus();
                return;
            }


            if (dgMainDC.Enabled && dgMainDC.Rows.Count > 0)
            {
                SaveRec();
            }
            else
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "Record Not Exist In Table";
                // ShowMessage("#Avisos", "", CommonClasses.MSG_Warning);
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);
                //PanelMsg.Visible = true;
                //lblmsg.Text = "Record Not Exist In Grid View";
                return;
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Delivery Challan", "btnSubmit_Click", Ex.Message);
        }
    }
Beispiel #13
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            if (((DataTable)ViewState["dt"]).Rows.Count > 0)
            {
                //foreach (DataRow item in ((DataTable)ViewState["dt"]).Rows)
                //{

                if (CommonClasses.Execute1("UPDATE ITEM_MASTER SET I_TEMP_CURRENT_BAL=0 WHERE (I_TEMP_CURRENT_BAL <> 0) AND (ES_DELETE = 0) "))
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "alert('Cleared');", true);
                    Response.Redirect("~/Masters/ADD/UtilityDefault.aspx", false);
                }
                else
                {
                    PanelMsg.Visible = true;
                    lblmsg.Text      = "Not cleared";
                    ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert1();", true);

                    return;
                }
                //}
            }
            else
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "Record not found";
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert1();", true);

                return;
            }
        }
        catch (Exception ex)
        {
            CommonClasses.SendError("Clear Unused Stock", "btnSubmit_Click", ex.Message.ToString());
        }
    }
    protected void btnShow_Click(object sender, EventArgs e)
    {
        try
        {
            //DateTime dt = new DateTime();
            //dt = Convert.ToDateTime(txtMonth.Text);

            //Session["Date"] = dt;
            if (chkAll.Checked == true && chkAllSupplier.Checked == true)
            {
                Response.Redirect("~/RoportForms/ADD/SupplierTypeMaster.aspx?Title=" + Title + "&All_code=" + chkAll.Checked.ToString() + "&val_code=" + ddlSupplierName.SelectedValue.ToString() + "&SupplierAll_code=" + chkAllSupplier.Checked.ToString() + "", false);
            }
            if (chkAll.Checked == false && chkAllSupplier.Checked == true)
            {
                Response.Redirect("~/RoportForms/ADD/SupplierTypeMaster.aspx?Title=" + Title + "&All_code=" + chkAll.Checked.ToString() + "&val_code=" + ddlSupplierName.SelectedValue.ToString() + "&SupplierAll_code=" + chkAllSupplier.Checked.ToString() + "", false);
            }
            if (chkAll.Checked == true && chkAllSupplier.Checked == false)
            {
                Response.Redirect("~/RoportForms/ADD/SupplierTypeMaster.aspx?Title=" + Title + "&All_code=" + chkAll.Checked.ToString() + "&val_code=" + ddlSupplierCode.SelectedValue.ToString() + "&SupplierAll_code=" + chkAllSupplier.Checked.ToString() + "", false);
            }
            if (chkAll.Checked == false && chkAllSupplier.Checked == false)
            {
                if (ddlSupplierName.SelectedIndex != 0 && ddlSupplierCode.SelectedIndex != 0)
                {
                    Response.Redirect("~/RoportForms/ADD/SupplierTypeMaster.aspx?Title=" + Title + "&All_code=" + chkAll.Checked.ToString() + "&val_code=" + ddlSupplierName.SelectedValue.ToString() + "&SupplierAll_code=" + chkAllSupplier.Checked.ToString() + "", false);
                }
                else
                {
                    ShowMessage("#Avisos", "Please Select Sector  ", CommonClasses.MSG_Warning);
                    return;
                }
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Supplier Master Register", "btnShow_Click", Ex.Message);
        }
    }
    bool CheckValid()
    {
        bool flag = false;

        try
        {
            if (txtScheduleDate.Text == "")
            {
                flag = false;
            }

            else
            {
                flag = true;
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Issue To Production", "CheckValid", Ex.Message);
        }

        return(flag);
    }
Beispiel #16
0
    public bool SaveLogin()
    {
        bool result = false;

        try
        {
            DL_DBAccess = new DatabaseAccessLayer();


            SqlParameter[] par = new SqlParameter[1];
            par[0] = new SqlParameter("@LoginCode", LoginCode);
            result = DL_DBAccess.Insertion_Updation_Delete("SP_CM_UpdateRemoveLoginFlag", par);
            if (result == true)
            {
                Msg = "Data Updated Successfully";
            }
        }
        catch (Exception ex)
        {
            CommonClasses.SendError("Remove Modify Lock Class", "SaveLogin", ex.Message);
        }
        return(result);
    }
Beispiel #17
0
 protected void chkFormToAll_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (chkFormToAll.Checked == true)
         {
             txtFormDate.Enabled = false;
             txtToDate.Enabled   = false;
         }
         else
         {
             txtFormDate.Enabled = true;
             txtToDate.Enabled   = true;
             txtFormDate.Attributes.Add("readonly", "readonly");
             txtToDate.Attributes.Add("readonly", "readonly");
             return;
         }
     }
     catch (Exception ex)
     {
         CommonClasses.SendError("Material Inspection", "chkFormToAll_CheckedChanged", ex.Message.ToString());
     }
 }
Beispiel #18
0
 protected void dgBatch_RowEditing(object sender, GridViewEditEventArgs e)
 {
     try
     {
         if (CommonClasses.ValidRights(int.Parse(right.Substring(2, 1)), this, "For Modify"))
         {
             string ce_code = ((Label)(dgBatch.Rows[e.NewEditIndex].FindControl("lblTSM_CODE"))).Text;
             string type    = "MODIFY";
             Response.Redirect("~/Transactions/ADD/TinterSheet.aspx?c_name=" + type + "&ce_code=" + ce_code, false);
         }
         else
         {
             PanelMsg.Visible = true;
             lblmsg.Text      = "You have no rights to modify";
             ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);
             return;
         }
     }
     catch (Exception Ex)
     {
         CommonClasses.SendError("Tinter Sheet", "dgBatch_RowEditing", Ex.Message);
     }
 }
Beispiel #19
0
    private void LoadFillOffSheet()
    {
        try
        {
            DataTable dt = new DataTable();

            dt = CommonClasses.Execute("SELECT FOS_CODE,FOS_NO,BT_NO as FOS_BATCH_NO,convert(varchar,FOS_DATE,106) as FOS_DATE FROM FILL_OFF_SHEET,BATCH_MASTER WHERE BT_CODE=FOS_BT_CODE and FOS_CM_CODE= '" + Convert.ToInt32(Session["CompanyCode"]) + "' AND FILL_OFF_SHEET.ES_DELETE=0  ORDER BY FOS_NO DESC");
            if (dt.Rows.Count == 0)
            {
                LoadStatus(txtString);
            }
            else
            {
                dgFillOffSheet.DataSource = dt;
                dgFillOffSheet.DataBind();
                //  dgFillOffSheet.Enabled = false;
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Fill Off Sheet-View", "LoadFillOffSheet", Ex.Message);
        }
    }
Beispiel #20
0
    bool CheckValid()
    {
        bool flag = false;

        try
        {
            if (txtQuery.Text == "")
            {
                flag = false;
            }

            else
            {
                flag = true;
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Paid Holidays", "CheckValid", Ex.Message);
        }

        return(flag);
    }
    protected void ddlSItemCodeno_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            if (ddlSItemCodeno.SelectedIndex != -1)
            {
                ddlSItemName.SelectedValue = ddlSItemCodeno.SelectedValue.ToString();
                DataTable dt = new DataTable();
                dt = CommonClasses.Execute("SELECT ITEM_UNIT_MASTER.I_UOM_CODE,ITEM_UNIT_MASTER.I_UOM_NAME FROM ITEM_UNIT_MASTER,ITEM_MASTER WHERE ITEM_UNIT_MASTER.I_UOM_CODE = ITEM_MASTER.I_UOM_CODE AND I_CODE='" + ddlSItemName.SelectedValue + "' and ITEM_MASTER.ES_DELETE=0");


                if (dt.Rows.Count > 0)
                {
                    txtSinUOM.Text = dt.Rows[0]["I_UOM_NAME"].ToString();
                }
                ddlSItemName.Focus();
            }
        }
        catch (Exception ex)
        {
            CommonClasses.SendError("Bill of Material", "ddlSItemCodeno_SelectedIndexChanged", ex.Message);
        }
    }
Beispiel #22
0
    bool ModifyLog(string PrimaryKey)
    {
        try
        {
            CheckModifyLog = false;
            //lblmsg.Visible = false;
            //lblmsg.Text = "";
            DataTable dt = CommonClasses.Execute("SELECT MODIFY FROM ITEM_SUBCATEGORY_MASTER WHERE SCAT_CODE=" + PrimaryKey + "  ");
            if (Convert.ToBoolean(dt.Rows[0][0].ToString()) == true)
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "Record Used By Another User";

                return(true);
            }
        }
        catch (Exception exc)
        {
            CommonClasses.SendError("User Master", "GridView1_RowEditing", exc.Message);
        }

        return(false);
    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        try
        {
            if (CommonClasses.ValidRights(int.Parse(right.Substring(2, 1)), this, "For Update"))
            {
                string user_code = ((Label)(dgPoTypeMaster.Rows[e.NewEditIndex].FindControl("lblPO_T_CODE"))).Text;
                string type      = "MODIFY";
                Response.Redirect("~/Masters/ADD/PoTypeMaster.aspx?c_name=" + type + "&u_code=" + user_code, false);
            }
            else
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "You Have No Rights To Modify";

                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);
            }
        }
        catch (Exception exc)
        {
            CommonClasses.SendError("Po Type Master", "GridView1_RowEditing", exc.Message);
        }
    }
    private void LoadCountry()
    {
        DataTable dt = new DataTable();

        try
        {
            CompanyMaster_BL = new CompanyMaster_BL();
            dt = CommonClasses.Execute("select COUNTRY_CODE,COUNTRY_NAME from COUNTRY_MASTER where ES_DELETE=0 and COUNTRY_CM_COMP_ID=" + Session["CompanyId"] + "");
            ddlCountry.DataSource     = dt;
            ddlCountry.DataTextField  = "COUNTRY_NAME";
            ddlCountry.DataValueField = "COUNTRY_CODE";
            ddlCountry.DataBind();
            ddlCountry.Items.Insert(0, new ListItem("------Country-------", "0"));
        }
        catch (Exception ex)
        {
            CommonClasses.SendError("Company Master", "LoadCountry", ex.Message);
        }
        finally
        {
            dt.Dispose();
        }
    }
Beispiel #25
0
    public bool Save()
    {
        bool result = false;

        DL_DBAccess = new DatabaseAccessLayer();
        try
        {
            if (CheckExistSaveName())
            {
                CommonClasses.Execute("INSERT INTO SALES_TAX_MASTER(ST_CM_COMP_ID, ST_TAX_NAME, ST_ALIAS,ST_SALES_TAX, ST_TCS_TAX, ST_SET_OFF, ST_FORM_NO, ST_SALES_ACC_HEAD, ST_TAX_ACC_HEAD,ST_TAX_SALE_ACC,ST_TAX_PUR_ACC)VALUES(" + ST_CM_COMP_ID + ",'" + ST_TAX_NAME + "','" + ST_ALIAS + "','" + ST_SALES_TAX + "','" + ST_TCS_TAX + "','" + ST_SET_OFF + "','" + ST_FORM_NO + "','" + ST_SALES_ACC_HEAD + "','" + ST_TAX_ACC_HEAD + "','" + ST_TAX_SALE_ACC + "','" + ST_TAX_PUR_ACC + "')");
                result = true;
            }
            else
            {
                Msg = "Tax Name Already Exist";
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Sales Tax Master Class", "Save", Ex.Message);
        }
        return(result);
    }
    bool ModifyLog(string PrimaryKey)
    {
        try
        {
            DataTable dt = CommonClasses.Execute("select MODIFY from ITEM_UNIT_MASTER where I_UOM_CODE=" + PrimaryKey + "  ");
            if (dt.Rows.Count > 0)
            {
                if (Convert.ToBoolean(dt.Rows[0][0].ToString()) == true)
                {
                    ShowMessage("#Avisos", "Record used by another user", CommonClasses.MSG_Warning);
                    ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);

                    return(true);
                }
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Unit Master - View", "ModifyLog", Ex.Message);
        }

        return(false);
    }
    bool ModifyLog(string PrimaryKey)
    {
        try
        {
            CheckModifyLog = false;
            //lblmsg.Visible = false;
            //lblmsg.Text = "";
            DataTable dt = CommonClasses.Execute("select MODIFY from PROJECT_CODE_MASTER where PROCM_CODE=" + PrimaryKey + "  ");
            if (Convert.ToBoolean(dt.Rows[0][0].ToString()) == true)
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "Record Used By Another User";

                return(true);
            }
        }
        catch (Exception exc)
        {
            CommonClasses.SendError("Project Code Master", "GridView1_RowEditing", exc.Message);
        }

        return(false);
    }
    private void ViewRec(string str)
    {
        try
        {
            DataTable dt = new DataTable();

            dt = CommonClasses.Execute("SELECT * FROM ACCOUNT_LEDGER where L_CODE='" + Convert.ToInt32(ViewState["mlCode"].ToString()) + "'");
            if (dt.Rows.Count > 0)
            {
                txtLedgerName.Text      = dt.Rows[0]["L_NAME"].ToString();
                ddlACType.SelectedValue = dt.Rows[0]["L_ACCTYPE"].ToString();
                txtOpeningBal.Text      = dt.Rows[0]["L_OPBAL"].ToString();
            }
            if (str == "MOD")
            {
                CommonClasses.SetModifyLock("ACCOUNT_LEDGER", "MODIFY", "L_CODE", Convert.ToInt32(ViewState["mlCode"].ToString()));
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Account Ledger Master", "ViewRec", Ex.Message);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty((string)Session["CompanyId"]) && string.IsNullOrEmpty((string)Session["Username"]))
         {
             Response.Redirect("~/Default.aspx", false);
         }
         else
         {
             if (!IsPostBack)
             {
                 DataTable dtRights = CommonClasses.Execute("select UR_RIGHTS from USER_RIGHT where UR_IS_DELETE=0 AND UR_UM_CODE='" + Convert.ToInt32(Session["UserCode"]) + "' and UR_SM_CODE='39'");
                 right = dtRights.Rows.Count == 0 ? "00000000" : dtRights.Rows[0][0].ToString();
                 LoadInward();
             }
         }
     }
     catch (Exception Ex)
     {
         CommonClasses.SendError("Material Inward", "Page_Load", Ex.Message);
     }
 }
Beispiel #30
0
    protected void btnAddNew_Click(object sender, EventArgs e)
    {
        try
        {
            if (CommonClasses.ValidRights(int.Parse(right.Substring(3, 1)), this, "For Add"))
            {
                string type = "INSERT";
                Response.Redirect("~/Transactions/ADD/AnnualMaintainceContract.aspx?c_name=" + type, false);
            }
            else
            {
                PanelMsg.Visible = true;
                lblmsg.Text      = "You Have No Rights To Add";
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);

                return;
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("AMC Transaction", "btnAddNew_Click", Ex.Message);
        }
    }
 void Awake()
 {
     if(common == null){
         DontDestroyOnLoad(gameObject);
         common = this;
     } else {
         Destroy(gameObject);
     }
 }
Beispiel #32
0
 // Use this for initialization
 void OnEnable()
 {
     //handler = GameHandler.handler;
     Debug.Log(target);
     controller = GetComponent<CharacterController>();
     body = target.GetComponent<Body>();
     common = CommonClasses.common;
     if(targetAI == targetAIs.Self){
         target = tower.gameObject;
     }
     tombName = gameObject.name;
     tombName = tombName.Remove(tombName.Length - 7);
     Debug.Log("Starting "+tombName);
 }