示例#1
0
        private void cmd0_Insp_Done_Click(object sender, EventArgs e)
        {
            int   nRet_Val = 0;
            INGRN clsINGRN = new INGRN();

            if (lblInv_SqNo.Text == "")
            {
                clsHomeScreen.Display_Message("Please select a record for Inspection Done...", false);
                return;
            }

            //---user authorizations
            //if (!(pUser_Auth(pcU_M_09_C03_D, 1, 1)))
            //{
            //    return;
            //}

            //---alert
            if (MessageBox.Show(cnMsg_Before_Inspection_Done, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            //strAuth_D = mSys_IN.pcU_M_01_C07B_A;

            int nDept_ID       = -1;
            int nDept_ID_Store = -1;
            int nBranch_ID     = -1;

            //double nQty_FOC = Convert.ToDouble(gridView1.Columns["R_Qty_FOC"].SummaryItem.SummaryValue);
            //double nQty_Accepted = Convert.ToDouble(gridView1.Columns["R_Qty_Accepted"].SummaryItem.SummaryValue);
            double nQty_Item = 0;



            nRet_Val = clsINGRN.Save_Authorize(Convert.ToInt32(lblInv_SqNo.Text), txtTr_No.Text.Trim(), Convert.ToDateTime(dtpTr_Date.EditValue), mSys_System.pFYSDate,
                                               nBranch_ID, nDept_ID, nDept_ID_Store, nQty_Item, txtRef1.Text, txtRef1.Text,
                                               mSys_System.pTrLevel_Inspection_Done, mSys_System.pComp_ID, mSys_System.pUserName, mSys_System.pUser_ID, strAuth_D, mSys_System.pFY_ID);


            if (clsINGRN.strErrorCode.Trim() != "")
            {
                clsHomeScreen.Display_Message(cnMsg_ErrSaveUpdate + clsINGRN.strErrorCode + "....................", false);
                return;
            }
            if (nRet_Val == 1)
            {
                clsHomeScreen.Display_Message(cnMsg_SaveUpdateComplete, true);
                lblTrLevel.Text = mSys_System.pTrLevel_Inspection_Done.ToString();
                Set_TrLevel();
                return;
            }
            else if (nRet_Val == -1)
            {
                clsHomeScreen.Display_Message(clsINGRN.strErr_Msg, false);
                return;
            }
        }
示例#2
0
        private void cmd0_Rollback_Click(object sender, EventArgs e)
        {
            int   nRet_Val = 0;
            INGRN clsINGRN = new INGRN();

            if (lblInv_SqNo.Text == "")
            {
                clsHomeScreen.Display_Message("Please select a record to Rollback...", false);
                return;
            }

            //---user authorizations
            //if (!(pUser_Auth(pcU_M_09_C03_D, 1, 1)))
            //{
            //    return;
            //}

            //---alert
            if (MessageBox.Show(cnMsg_BeforeRollback, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            //strAuth_D = mSys_IN.pcU_M_01_C07D_RB;
            nRet_Val = clsINGRN.Save_Rollback(Convert.ToInt32(lblInv_SqNo.Text), Convert.ToInt32(lblTrLevel.Text), mSys_System.pComp_ID, mSys_System.pBranch_ID, mSys_System.pUserName, mSys_System.pUser_ID, strAuth_D, mSys_System.pFY_ID);
            if (clsINGRN.strErrorCode.Trim() != "")
            {
                clsHomeScreen.Display_Message(cnMsg_ErrSaveUpdate + clsINGRN.strErrorCode + "....................", false);
                return;
            }
            if (nRet_Val == 1)
            {
                clsHomeScreen.Display_Message(cnMsg_SaveUpdateComplete, true);
                if (lblTrLevel.Text == mSys_System.pTrLevel_Under_Inspection.ToString())
                {
                    lblTrLevel.Text = mSys_System.pTrLevel_Pending.ToString();
                }
                else if (lblTrLevel.Text == mSys_System.pTrLevel_Inspection_Done.ToString())
                {
                    lblTrLevel.Text = mSys_System.pTrLevel_Under_Inspection.ToString();
                }
                else if (lblTrLevel.Text == mSys_System.pTrLevel_Cleared.ToString())
                {
                    lblTrLevel.Text = mSys_System.pTrLevel_Inspection_Done.ToString();
                }

                Set_TrLevel();
                return;
            }
            else if (nRet_Val == -1)
            {
                clsHomeScreen.Display_Message(clsINGRN.strErr_Msg, false);
                return;
            }
        }
示例#3
0
        private void Fill_Combo()
        {
            database1 clsdatabase1 = new database1();
            INGRN     clsINGRN     = new INGRN();
            DataSet   ds           = clsINGRN.Fill_Combo(mSys_System.pComp_ID, mSys_System.pUser_ID);

            if (clsINGRN.sErrorCode != "")
            {
                clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsdatabase1.sErrorCode + "'", false);
                return;
            }
            Set_Combo(lookBranch_ID, ds.Tables[0], "Branch_D", "Branch_ID", true);
            Set_Combo(lookCredit_ID, ds.Tables[1], "CreditD", "CreditID", true);
            Set_Combo(lookDType, ds.Tables[2], "DType_DD", "DType_ID", true);
        }
示例#4
0
        private void Fill_SCat()
        {
            INGRN     clsINGRN = new INGRN();
            DataSet   ds       = clsINGRN.Fill_SCat(mSys_System.pComp_ID, mSys_System.pUser_ID);
            DataTable dt       = ds.Tables[0];
            DataRow   row      = dt.NewRow();

            row["SCat_DD"] = string.Empty;
            row["SCat_ID"] = 0;
            dt.Rows.InsertAt(row, 0);
            repositoryItemLookUpEdit3.DataSource    = dt;
            repositoryItemLookUpEdit3.ValueMember   = "SCat_ID";
            repositoryItemLookUpEdit3.DisplayMember = "SCat_DD";
            gridView1.Columns["SCat_ID"].ColumnEdit = repositoryItemLookUpEdit3;
        }
示例#5
0
        private void Find_Record(int ID)
        {
            database1 clsdatabase1 = new database1();
            INGRN     clsINGRN     = new INGRN();
            DataSet   ds           = new DataSet();

            ds = clsINGRN.Find_Record(mSys_System.pComp_ID, ID);
            if (clsINGRN.sErrorCode != "")
            {
                clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsdatabase1.sErrorCode + "'", false);
                return;
            }
            DataTable dt = ds.Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                lblInv_SqNo.Text = dt.Rows[i]["Inv_SqNo"].ToString();
                txtTr_No.Text    = dt.Rows[i]["Tr_No"].ToString();
                dtpTr_Date.Text  = dt.Rows[i]["Tr_Date"].ToString();

                cmbDept_ID.EditValue       = (dt.Rows[i]["Dept_ID"] == null || dt.Rows[i]["Dept_ID"].ToString() == "" ? "-1" : dt.Rows[i]["Dept_ID"]);
                cmbDept_ID_Store.EditValue = (dt.Rows[i]["Dept_ID_Store"] == null || dt.Rows[i]["Dept_ID_Store"].ToString() == "" ? "-1" : dt.Rows[i]["Dept_ID_Store"]);
                lookCredit_ID.EditValue    = (dt.Rows[i]["Credit_ID"] == null || dt.Rows[i]["Credit_ID"].ToString() == "" ? "-1" : dt.Rows[i]["Credit_ID"]);
                //cmbCC.EditValue = (dt.Rows[i]["cmbCC"] == null || dt.Rows[i]["cmbCC"].ToString() == "" ? "-1" : dt.Rows[i]["cmbCC"]);

                txtAmt_Item.Text  = dt.Rows[i]["Amt_Item"].ToString();
                txtAmt_Total.Text = dt.Rows[i]["Amt_Total"].ToString();
                txtAmt_CC.Text    = dt.Rows[i]["Amt_CC"].ToString();
                txtAmt_Cash.Text  = dt.Rows[i]["Amt_Cash"].ToString();
                txtAmt_Dis.Text   = dt.Rows[i]["Amt_Dis"].ToString();
                txtAmt_Bal.Text   = dt.Rows[i]["Amt_Bal"].ToString();
                lblTrLevel.Text   = dt.Rows[i]["TrLevel"].ToString();
                lblTrLevelD.Text  = dt.Rows[i]["TrLevelD"].ToString();
                txtRef1.Text      = dt.Rows[i]["Ref1"].ToString();

                txtInv_No.Text = dt.Rows[i]["Party_InvNo"].ToString();
                txtGP_No.Text  = dt.Rows[i]["GP_No"].ToString();

                dtpGP_Date.Text = dt.Rows[i]["GP_Date"].ToString();
            }
            DataTable dt1 = ds.Tables[1];

            gridControl1.DataSource = dt1;
            Set_TrLevel();
            Calculation();
        }
示例#6
0
文件: PR.cs 项目: AskariSoft/ERP
        private void lookBranch_ID_EditValueChanged(object sender, EventArgs e)
        {
            database1 clsdatabase1 = new database1();
            INGRN     clsINGRN     = new INGRN();
            DataSet   ds           = new DataSet();
            int       vBranch      = -1;

            if (lookBranch_ID.EditValue != null)
            {
                vBranch = Convert.ToInt32(lookBranch_ID.EditValue);
            }
            ds = clsINGRN.Fill_Combo(mSys_System.pComp_ID, mSys_System.pUser_ID, vBranch);
            if (clsINGRN.sErrorCode != "")
            {
                clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsdatabase1.sErrorCode + "'", false);
                return;
            }
            Set_Combo(cmbDept_ID, ds.Tables[0], "Dept_DD", "Dept_ID", true);
            Set_Combo(cmbDept_ID_Store, ds.Tables[1], "Dept_DD", "Dept_ID", true);
            Set_Combo(lookSub_ID, ds.Tables[2], "Sub_CodeD", "Sub_ID", true);
        }
示例#7
0
        private bool Save_Update(int IsUpdate)
        {
            INGRN clsINGRN  = new INGRN();
            int   Ret_Value = 0;

            if (IsUpdate == 0)
            {
                //---alert
                //strAuth_D = mSys_IN.pcU_M_01_C07_S;
                if (MessageBox.Show(Msg_BeforeSave, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return(false);
                }
            }
            else if (IsUpdate == 1) //---update
            {
                //strAuth_D = mSys_IN.pcU_M_01_C07_U;
                //---alert
                if (MessageBox.Show(Msg_BeforeUpdate, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return(false);
                }
            }

            DataTable dt_1 = Set_Grid();

            for (int i = 0; i < gridView1.DataRowCount; i++)
            {
                DataRow row = dt_1.NewRow();
                if (gridView1.GetRowCellValue(i, "Item_ID") != null)
                {
                    if (gridView1.GetRowCellValue(i, "Item_ID").ToString() != "-1")
                    {
                        row["Item_ID"]    = gridView1.GetRowCellValue(i, "Item_ID");
                        row["SCat_ID"]    = gridView1.GetRowCellValue(i, "SCat_ID");
                        row["R_Qty"]      = gridView1.GetRowCellValue(i, "R_Qty");
                        row["R_Rate"]     = gridView1.GetRowCellValue(i, "R_Rate");
                        row["R_Rate_FCY"] = gridView1.GetRowCellValue(i, "R_Rate_FCY");
                        row["Rate_1"]     = gridView1.GetRowCellValue(i, "Rate_1");
                        row["Ref4"]       = gridView1.GetRowCellValue(i, "Ref4");
                        //row["Item_ID"] = gridView1.GetRowCellValue(i, "Item_ID");
                        dt_1.Rows.Add(row);
                    }
                }
            }
            List <DataRow> Child = new List <DataRow>(dt_1.Select());


            string TrType        = "Cash";
            int    CC            = 0;
            int    Credit_ID     = 0;
            int    Dept_ID       = 0;
            int    Dept_ID_Store = 0;
            int    nTrLevel      = 0;

            TrType = lblPO_For.Text.Trim();

            double Amt_Cash  = txtAmt_Cash.Text == "" ? 0 : Convert.ToDouble(txtAmt_Cash.Text);
            double Amt_CC    = txtAmt_CC.Text == "" ? 0 : Convert.ToDouble(txtAmt_CC.Text);
            double Amt_Bal   = txtAmt_Bal.Text == "" ? 0 : Convert.ToDouble(txtAmt_Bal.Text);
            double Amt_Item  = txtAmt_Item.Text == "" ? 0 : Convert.ToDouble(txtAmt_Item.Text);
            double Amt_Total = txtAmt_Total.Text == "" ? 0 : Convert.ToDouble(txtAmt_Total.Text);
            double Amt_Dis   = txtAmt_Dis.Text == "" ? 0 : Convert.ToDouble(txtAmt_Dis.Text);
            double Qty_Item  = Convert.ToDouble(gridView1.Columns["R_Qty"].SummaryItem.SummaryValue);
            double Curr_Rate = txtCurr_Rate.Text == "" ? 1 : Convert.ToDouble(txtCurr_Rate.Text);
            //double GST_Total = txtAmt_R1.Text == "" ? 1 : Convert.ToDouble(txtAmt_R1.Text);
            double GST_Total = Convert.ToDouble(gridView1.Columns["Amt_R1"].SummaryItem.SummaryValue);

            if (cmbCC.EditValue != null && cmbCC.EditValue.ToString() != "")
            {
                CC = Convert.ToInt32(cmbCC.EditValue.ToString());
            }
            if (lookCredit_ID.EditValue != null && lookCredit_ID.EditValue.ToString() != "")
            {
                Credit_ID = Convert.ToInt32(lookCredit_ID.EditValue.ToString());
            }
            if (cmbDept_ID.EditValue != null && cmbDept_ID.EditValue.ToString() != "")
            {
                Dept_ID = Convert.ToInt32(cmbDept_ID.EditValue.ToString());
            }
            if (cmbDept_ID_Store.EditValue != null && cmbDept_ID_Store.EditValue.ToString() != "")
            {
                Dept_ID_Store = Convert.ToInt32(cmbDept_ID_Store.EditValue.ToString());
            }
            if (lblTrLevel.Text != "")
            {
                nTrLevel = Convert.ToInt32(lblTrLevel.Text);
            }

            Ret_Value = clsINGRN.Save_Master(lblInv_SqNo.Text, txtTr_No.Text.Trim(), Convert.ToDateTime(dtpTr_Date.EditValue),
                                             lblCurrID.Text.Trim(), Curr_Rate, GST_Total, Qty_Item,
                                             Convert.ToInt32(lookSub_ID.GetColumnValue("Detail_ID")), Convert.ToInt32(lookSub_ID.GetColumnValue("Detail_ID")), Dept_ID, Dept_ID_Store, mSys_System.pBranch_ID,
                                             Credit_ID, TrType, txtInv_No.Text.Trim(), txtGP_No.Text.Trim(), Convert.ToDateTime(dtpGP_Date.EditValue), txtRef1.Text,
                                             Amt_Cash, Amt_CC, Amt_Dis, Amt_Item, Amt_Total, Amt_Bal, CC, Child, mSys_System.pComp_ID,
                                             mSys_System.pUserName, mSys_System.pUser_ID, nTrLevel, IsUpdate, strAuth_D
                                             );
            if (clsINGRN.sErrorCode != "")
            {
                clsHomeScreen.Display_Message(clsINGRN.sErrorCode + "......", false);
                return(false);
            }
            if (Ret_Value == -1)
            {
                clsHomeScreen.Display_Message(clsINGRN.strErr_Msg + "....................", false);
                return(false);
            }
            if (Ret_Value == 0)
            {
                clsHomeScreen.Display_Message(Msg_ErrSaveUpdate + "....................", false);
                return(false);
            }
            if (Ret_Value == 1)
            {
                txtTr_No.Text    = clsINGRN.str_Code;
                lblInv_SqNo.Text = clsINGRN.str_ID.ToString();

                //lblU_S.Text = clsINGRN.strU_S;
                //lblPDate.Text = clsINGRN.strPDate;
                //lblU_U.Text = clsINGRN.strU_U;
                //lblU_UD.Text = clsINGRN.strU_UD;

                clsHomeScreen.Display_Message(Msg_SaveUpdateComplete + "....................", true);
            }

            return(true);
        }