Пример #1
0
    private Boolean isValid()
    {
        hid_FileId.Value     = "%";
        hid_SupplierId.Value = "%";

        if (dd_FileNo.SelectedValue != "0")
        {
            hid_FileId.Value = dd_FileNo.SelectedValue.ToString() + "X%";
        }

        if (dd_Supplier.SelectedValue != "0")
        {
            hid_SupplierId.Value = dd_Supplier.SelectedValue.ToString() + "X%";
        }



        CommonFunctions commonFunctions = new CommonFunctions();

        CommonFunctions.Date_Validation dv = new CommonFunctions.Date_Validation();
        if (dv.date_Validate(txt_fromDate.Text) == false)
        {
            lbl_msg.Visible = true;
            lbl_msg.Text    = "From Date is Invalid!";
            return(false);
        }
        if (dv.date_Validate(txt_toDate.Text) == false)
        {
            lbl_msg.Visible = true;
            lbl_msg.Text    = "To Date is Invalid!";
            return(false);
        }

        return(true);
    }
Пример #2
0
    protected void gdv_commonForm_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            CommonFunctions.Date_Validation dateValidation = new CommonFunctions.Date_Validation();

            List <string> s_visible = new List <string>(4);
            s_visible = (List <string>)ViewState[ViewStateKeys.S_visible];

            hidIsInsertMode.Value = "False";
            btn_save.Text         = "Update";
            gdv_commonForm.EnableModelValidation = false;

            int i_ind = 1;

            if (s_visible[0] == "Y")
            {
                txt_1stColumn.Text = HttpUtility.HtmlDecode(gdv_commonForm.Rows[gdv_commonForm.SelectedIndex].Cells[i_ind].Text);
                i_ind += 1;
            }
            if (s_visible[1] == "Y")
            {
                txt_2stColumn.Text = HttpUtility.HtmlDecode(gdv_commonForm.Rows[gdv_commonForm.SelectedIndex].Cells[i_ind].Text);
                i_ind += 1;
            }
            if (s_visible[2] == "Y")
            {
                txt_code.Text = HttpUtility.HtmlDecode(gdv_commonForm.Rows[gdv_commonForm.SelectedIndex].Cells[i_ind].Text);
                i_ind        += 1;
            }
            if (s_visible[3] == "Y")
            {
                txt_serialNo.Text = HttpUtility.HtmlDecode(gdv_commonForm.Rows[gdv_commonForm.SelectedIndex].Cells[i_ind].Text);
                i_ind            += 1;
            }
            if (s_visible[4] == "Y")
            {
                if (HttpUtility.HtmlDecode(gdv_commonForm.Rows[gdv_commonForm.SelectedIndex].Cells[i_ind].Text.Trim().ToString()) == "Y")
                {
                    chk_active.Checked = true;
                }
                else
                {
                    chk_active.Checked = false;
                }
                i_ind += 1;
            }

            Session[GlobalVariables.g_s_insertMode] = "1";
        }
        catch
        {
        }
    }
Пример #3
0
    public void Logout()
    {
        Connection connection = new Connection();

        CommonFunctions.Date_Validation date_validation = new CommonFunctions.Date_Validation();
        string s_upadateLogbook = string.Empty;

        s_upadateLogbook = Procedures.Common.Proc_Web_Update_UserLogBook
                           + "'"
                           + Session[GlobalVariables.g_s_userLogBookAutoId].ToString()
                           + "','"
                           + DateTime.Now.ToString(new CultureInfo("en-US"))
                           + "'";
        connection.connection_DB(s_upadateLogbook, 1, false, true, true);
        Session.RemoveAll();
        Response.Redirect(GlobalVariables.g_s_URL_loginPage);
    }
Пример #4
0
    private Boolean isValid()
    {
        CommonFunctions commonFunctions = new CommonFunctions();

        CommonFunctions.Date_Validation dv = new CommonFunctions.Date_Validation();

        hid_FileId.Value = "0";
        if (dd_File.SelectedValue == "0")
        {
            lbl_msg.Visible = true;
            lbl_msg.Text    = "File No Blank!";
            return(false);
        }
        else
        {
            hid_FileId.Value = dd_File.SelectedValue.ToString();
        }

        return(true);
    }
Пример #5
0
    protected void btn_save_Click(object sender, EventArgs e)
    {
        List <string> s_columnName = new List <string>(4);

        s_columnName = (List <string>)ViewState[ViewStateKeys.S_columnName];

        List <string> l_access_status = new List <string>(4);

        l_access_status = (List <string>)ViewState[ViewStateKeys.V_l_access_status];

        CommonFunctions.Date_Validation dataValidation = new CommonFunctions.Date_Validation();

        Connection connection = new Connection();

        if (b_biult_mustValidation() == false)
        {
            return;
        }
        if (s_biult_NumericValidation() == false)
        {
            return;
        }

        Session[GlobalVariables.g_s_TableName] = Request.QueryString["tableName"];
        try
        {
            string s_checkField_forDuplicateValue = string.Empty;

            s_checkField_forDuplicateValue = s_columnName[0];
            string s_activeValue = string.Empty;

            if (chk_active.Checked == true)
            {
                s_activeValue = "Y";
            }

            else
            {
                s_activeValue = "N";
            }

            if (Convert.ToString(Session[GlobalVariables.g_s_insertMode]) == "1" && l_access_status[1] == "Y")
            {
                Session[GlobalVariables.g_s_ColumnName] = s_biult_ColumnName();
                Session[GlobalVariables.g_s_Parameter]  = s_biult_Parameter()
                                                          + s_activeValue + "Ã"
                                                          + txt_1stColumn.Text.Trim().ToString().Replace(GlobalVariables.g_s_stringToReplace, GlobalVariables.g_s_stringByReplace) + "Ã";

                Session[GlobalVariables.g_s_DuplicateChecking] = "(" + s_biult_DuplicateChecking()
                                                                 + ") AND " + "autoId"
                                                                 + "<>" + "''" + gdv_commonForm.Rows[gdv_commonForm.SelectedIndex].Cells[0].Text + "''";


                string sql_Update = Procedures.Common.Proc_Insert_Update_Select_Independent_Tables5
                                    + " '"
                                    + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_TableName].ToString())
                                    + "','"
                                    + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_ColumnName].ToString())
                                    + "','"
                                    + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_Parameter].ToString())
                                    + "','"
                                    + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_DuplicateChecking].ToString())
                                    + "','"
                                    + HttpUtility.HtmlDecode(gdv_commonForm.Rows[gdv_commonForm.SelectedIndex].Cells[0].Text)
                                    + "','U','R',''";
                Session[GlobalVariables.g_s_procedureReturnType] = connection.connection_DB(sql_Update, 1, true, true, true);

                if (Session[GlobalVariables.g_s_procedureReturnType].ToString() != string.Empty && Session[GlobalVariables.g_s_procedureReturnType].ToString() != "D")
                {
                    v_loadGridView();
                    //insertMode();
                    btn_refresh_Click(new object(), new EventArgs());
                    lblMsg.Text = GlobalVariables.g_s_updateOperationSuccessfull;
                }
                else if (Session[GlobalVariables.g_s_procedureReturnType].ToString() == "D")
                {
                    lblMsg.Text = GlobalVariables.g_s_duplicateCheckWarningMessage;
                }
                else
                {
                    lblMsg.Text = GlobalVariables.g_s_updateOperationFailed;
                }
            }

            else
            {
                if (Convert.ToString(Session[GlobalVariables.g_s_insertMode]) == "1" && l_access_status[1] == "N")
                {
                    lblMsg.Text    = string.Empty;
                    lblMsg.Visible = true;
                    lblMsg.Text    = GlobalVariables.g_s_updateSecurityMessage;
                }

                if (b_checkAttributeRatings())
                {
                    string sql_save = string.Empty;
                    if (Convert.ToString(Session[GlobalVariables.g_s_insertMode]) == "0" && l_access_status[0] == "Y")
                    {
                        if (Session[GlobalVariables.g_s_TableName].ToString() == TableColumnName.T_Web_PerformanceTabDescription.TableName)
                        {
                            lblMsg.Text = "Please select from grid";
                        }
                        else
                        {
                            Session[GlobalVariables.g_s_ColumnName] = "";
                            Session[GlobalVariables.g_s_Parameter]  = "" + Session[GlobalVariables.g_s_autoId].ToString() + "Ã"
                                                                      + s_biult_Parameter()
                                                                      + txt_1stColumn.Text.Trim().ToString().Replace(GlobalVariables.g_s_stringToReplace, GlobalVariables.g_s_stringByReplace) + "Ã"
                                                                      + GlobalVariables.g_s_referenceId + "Ã"
                                                                      + Session[GlobalVariables.g_s_CompanyAutoId].ToString() + "Ã"
                                                                      + GlobalVariables.g_s_No + "Ã"
                                                                      + GlobalVariables.g_s_No + "Ã"
                                                                      + dataValidation.date_Format_Back_End(dataValidation.date_Format_Front_End(DateTime.Today)) + "Ã"
                                                                      + Session[GlobalVariables.g_s_userLogBookAutoId].ToString();

                            Session[GlobalVariables.g_s_DuplicateChecking] = "" + s_biult_DuplicateChecking();

                            sql_save = Procedures.Common.Proc_Insert_Update_Select_Independent_Tables5
                                       + " '"
                                       + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_TableName].ToString())
                                       + "','"
                                       + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_ColumnName].ToString())
                                       + "','"
                                       + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_Parameter].ToString())
                                       + "','"
                                       + HttpUtility.HtmlDecode(Session[GlobalVariables.g_s_DuplicateChecking].ToString())
                                       + "','','I','R',''";

                            Session[GlobalVariables.g_s_procedureReturnType] = connection.connection_DB(sql_save, 1, true, true, true);
                            if (Session[GlobalVariables.g_s_procedureReturnType].ToString() != string.Empty && Session[GlobalVariables.g_s_procedureReturnType].ToString() != "D")
                            {
                                v_loadGridView();
                                insertMode();
                                lblMsg.Text = GlobalVariables.g_s_insertOperationSuccessfull;
                            }
                            else if (Session[GlobalVariables.g_s_procedureReturnType].ToString() == "D")
                            {
                                lblMsg.Text = GlobalVariables.g_s_duplicateCheckWarningMessage;
                            }
                            else
                            {
                                lblMsg.Text = GlobalVariables.g_s_insertOperationFailed;
                            }
                        }

                        if (Convert.ToString(Session[GlobalVariables.g_s_insertMode]) == "0" && l_access_status[0] == "N")
                        {
                            lblMsg.Text    = string.Empty;
                            lblMsg.Visible = true;
                            lblMsg.Text    = GlobalVariables.g_s_insertSecurityMessage;
                        }
                    }
                }

                else
                {
                    lblMsg.Text = GlobalVariables.g_s_attributeRatingCheck;
                }
            }
        }
        catch (Exception)
        {
        }
    }
Пример #6
0
    private Boolean isValid()
    {
        Connection      conn = new Connection();
        CommonFunctions commonFunctions = new CommonFunctions();
        string          s_FileIdNeeded = string.Empty, returnValue = string.Empty;

        CommonFunctions.Date_Validation dv = new CommonFunctions.Date_Validation();
        if (dv.date_Validate(txtIssueDate.Text) == false)
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "BTB Issue Date Invalid!";
            return(false);
        }

        if (dd_Supplier.SelectedValue == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "Supplier Can Not Blank!";
            return(false);
        }

        if (dd_POSupplier.SelectedValue == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "Supplier(Purchase From) Can Not Blank!";
            return(false);
        }



        //if (txt_BTBNo.Text == "")
        //{
        //    lblsubmsg.Visible = true;
        //    lblsubmsg.Text = "BTB No Can Not Blank!";
        //    return false;
        //}

        if (dd_Currency.SelectedValue == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "Currency Can Not Blank!";
            return(false);
        }

        if (hid_Rownumber.Value == "0")
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "PI Grid Can Not Blank!";
            return(false);
        }

        hid_File_Id.Value = "0";
        if (dd_FileNo.SelectedValue != "0")
        {
            s_FileIdNeeded = "SELECT File_Ref_Id FROM TBL_Export_LC Where Export_LC_Id='" + dd_FileNo.SelectedValue + "'";
            returnValue    = conn.connection_DB(s_FileIdNeeded, 0, false, false, false);
            if (returnValue != GlobalVariables.g_s_connectionErrorReturnValue)
            {
                if (conn.ResultsDataSet.Tables[0] != null)
                {
                    foreach (DataRow drow in conn.ResultsDataSet.Tables[0].Rows)
                    {
                        hid_File_Id.Value = drow["File_Ref_Id"].ToString();
                    }
                }
            }
        }

        return(true);
    }