示例#1
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            try
            {
                frmSaleCarInOutCancel frmCancel = new frmSaleCarInOutCancel(txtCarID.TextBox.Text);
                LBShowForm.ShowDialog(frmCancel);

                if (frmCancel.IsAllowCancel)
                {
                    LBDbParameterCollection parmCol = new LBDbParameterCollection();
                    parmCol.Add(new LBParameter("SaleCarInBillID", enLBDbType.Int64, mlSaleCarInBillID));

                    DataSet dsReturn;
                    Dictionary <string, object> dictValue;
                    ExecuteSQL.CallSP(14106, parmCol, out dsReturn, out dictValue);

                    LB.WinFunction.LBCommonHelper.ShowCommonMessage("作废成功!");
                    ReadFeildValue();
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
示例#2
0
        private void grdMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
                {
                    DataRowView drvSelect = this.grdMain.Rows[e.RowIndex].DataBoundItem as DataRowView;
                    long        lCarID    = drvSelect["CarID"] == DBNull.Value ?
                                            0 : Convert.ToInt64(drvSelect["CarID"]);
                    long lCustomerID = drvSelect["CustomerID"] == DBNull.Value ?
                                       0 : Convert.ToInt64(drvSelect["CustomerID"]);
                    if (lCarID > 0)
                    {
                        frmCarEdit frmCar = new frmCarEdit(lCarID);
                        LBShowForm.ShowDialog(frmCar);

                        LoadDataSource();
                    }
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
 private void GrdMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
         {
             if (_BillStatus == enBillStatus.Add || _BillStatus == enBillStatus.Edit)
             {
                 string strColumn = this.grdMain.Columns[e.ColumnIndex].DataPropertyName;
                 if (strColumn.Equals("CarNum"))
                 {
                     long        lCustomerID = LBConverter.ToInt64(this.txtCustomerID.TextBox.SelectedItemID);
                     frmCarQuery frmCar      = new frmCarQuery(lCustomerID);
                     LBShowForm.ShowDialog(frmCar);
                     DataRowView drv = this.grdMain.Rows[e.RowIndex].DataBoundItem as DataRowView;
                     if (frmCar.LstReturn.Count > 0)
                     {
                         if (drv.Row.RowState == DataRowState.Unchanged)
                         {
                             drv.Row.SetModified();
                         }
                         drv["CarNum"] = frmCar.LstReturn[0]["CarNum"];
                         drv["CarID"]  = frmCar.LstReturn[0]["CarID"];
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
        private void btnAddDetail_Click(object sender, EventArgs e)
        {
            try
            {
                frmItemBaseManager frmItem = new frmItemBaseManager();
                frmItem.NeedReturn = true;
                LBShowForm.ShowDialog(frmItem);

                if (frmItem.LstReturn.Count > 0)
                {
                    foreach (DataRow dr in frmItem.LstReturn)
                    {
                        dr["ChangeBy"]   = "";
                        dr["ChangeTime"] = DBNull.Value;
                        DataView dvSource = this.grdMain.DataSource as DataView;
                        dvSource.Table.ImportRow(dr);
                        dvSource.Table.Rows[dvSource.Table.Rows.Count - 1]["CalculateType"] = 0;

                        /*int iRowIndex = this.grdMain.Rows.Add();
                         * this.grdMain.Rows[iRowIndex].Cells["ItemID"].Value = dr["ItemID"];
                         * this.grdMain.Rows[iRowIndex].Cells["ItemCode"].Value = dr["ItemCode"];
                         * this.grdMain.Rows[iRowIndex].Cells["ItemName"].Value = dr["ItemName"];
                         * this.grdMain.Rows[iRowIndex].Cells["ItemMode"].Value = dr["ItemMode"];
                         * this.grdMain.Rows[iRowIndex].Cells["ItemRate"].Value = dr["ItemRate"];
                         * this.grdMain.Rows[iRowIndex].Cells["UOMName"].Value = dr["UOMName"];*/
                    }
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
        private void btnApprove_Click(object sender, EventArgs e)
        {
            try
            {
                List <DataRow> lstSelected = ReadSelectedRows();

                int iIsSynCount = 0;
                foreach (DataRow dr in lstSelected)
                {
                    if (LBConverter.ToBoolean(dr["IsSynchronousToK3OutBill"]) || LBConverter.ToBoolean(dr["IsSynchronousToK3Receive"]))
                    {
                        iIsSynCount++;
                    }
                }

                bool bolIsReSynBill = false;
                if (iIsSynCount > 0)
                {
                    if (LB.WinFunction.LBCommonHelper.ConfirmMessage("选中的单据中存在已同步过的单据,是否继续同步?", "提示", MessageBoxButtons.OKCancel)
                        == DialogResult.OK)
                    {
                        bolIsReSynBill = true;
                    }
                }

                frmSynK3Process frmProcess = new frmSynK3Process(lstSelected, _SynType, bolIsReSynBill);
                LBShowForm.ShowDialog(frmProcess);
                this.LoadAllSalesBill();
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
示例#6
0
        private void btnRefCar_Click(object sender, EventArgs e)
        {
            try
            {
                frmCarRefCustomerQuery frmCarQuery = new frmCarRefCustomerQuery(mlCustomerID);
                LBShowForm.ShowDialog(frmCarQuery);
                if (frmCarQuery.LstReturn.Count > 0)
                {
                    //将车辆关联当前客户
                    DataTable dtSPIN = new DataTable();
                    dtSPIN.Columns.Add("CarID", typeof(long));
                    dtSPIN.Columns.Add("CustomerID", typeof(long));
                    foreach (DataRow dr in frmCarQuery.LstReturn)
                    {
                        DataRow drNew = dtSPIN.NewRow();
                        drNew["CarID"]      = dr["CarID"];
                        drNew["CustomerID"] = mlCustomerID;
                        dtSPIN.Rows.Add(drNew);
                    }
                    dtSPIN.AcceptChanges();
                    DataSet   dsReturn;
                    DataTable dtReturn;
                    Dictionary <string, object> dictValue;
                    ExecuteSQL.CallSP(13503, dtSPIN, out dsReturn, out dtReturn);

                    LoadCarDataSource();
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
示例#7
0
 private void btnAddOutBill_Click(object sender, EventArgs e)
 {
     try
     {
         frmAddOutBill frm = new LB.MI.frmAddOutBill();
         LBShowForm.ShowDialog(frm);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#8
0
 private void btnSynPrice_Click(object sender, EventArgs e)
 {
     try
     {
         frmWaistProcess frm = new frmWaistProcess();
         LBShowForm.ShowDialog(frm);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#9
0
 //权限配置
 private void btnPermissionConfig_Click(object sender, EventArgs e)
 {
     try
     {
         frmPermissionConfig frmView = new frmPermissionConfig();
         LBShowForm.ShowMainPage(frmView);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#10
0
 private void btnCameraDevice_Click(object sender, EventArgs e)
 {
     try
     {
         frmCameraConfig frmDevice = new frmCameraConfig();
         LBShowForm.ShowMainPage(frmDevice);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#11
0
 //备份设置
 private void btnDBBackUp_Click(object sender, EventArgs e)
 {
     try
     {
         frmBackUpConfig frmBackUp = new frmBackUpConfig();
         LBShowForm.ShowMainPage(frmBackUp);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#12
0
 private void btnChangePriceManager_Click(object sender, EventArgs e)
 {
     try
     {
         frmModifyBillHeaderQuery frmModify = new frmModifyBillHeaderQuery();
         LBShowForm.ShowMainPage(frmModify);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#13
0
 //添加客户
 private void btnAddCustomer_Click(object sender, EventArgs e)
 {
     try
     {
         frmCustomerEdit frmCustomer = new frmCustomerEdit(0);
         LBShowForm.ShowDialog(frmCustomer);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#14
0
 //充值记录
 private void btnRPReceiveList_Click(object sender, EventArgs e)
 {
     try
     {
         frmReceiveBillQuery frmQuery = new frmReceiveBillQuery();
         LBShowForm.ShowMainPage(frmQuery);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#15
0
 //车辆管理
 private void btnCarQuery_Click(object sender, EventArgs e)
 {
     try
     {
         frmCarWeightManager frmCar = new frmCarWeightManager();
         LBShowForm.ShowMainPage(frmCar);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#16
0
 private void btnReportManager_Click(object sender, EventArgs e)
 {
     try
     {
         frmReportView frmBill = new frmReportView();
         LBShowForm.ShowMainPage(frmBill);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#17
0
 //充值
 private void btnRPReceive_Click(object sender, EventArgs e)
 {
     try
     {
         frmEditReceiveBill frmReceive = new frmEditReceiveBill(0);
         LBShowForm.ShowDialog(frmReceive);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#18
0
 /// <summary>
 /// 系统设置
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDbSysConfig_Click(object sender, EventArgs e)
 {
     try
     {
         frmSysConfig frmConfig = new frmSysConfig();
         LBShowForm.ShowDialog(frmConfig);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#19
0
 //用户权限管理
 private void btnUserManager_Click(object sender, EventArgs e)
 {
     try
     {
         SysConfig.frmUserManager frmUserMag = new SysConfig.frmUserManager();
         LBShowForm.ShowMainPage(frmUserMag);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#20
0
 private void btnAddReportView_Click(object sender, EventArgs e)
 {
     try
     {
         frmAddReportView frmView = new MI.frmAddReportView(0);
         LBShowForm.ShowDialog(frmView);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#21
0
 private void btnChargeManager_Click(object sender, EventArgs e)
 {
     try
     {
         frmChargeTypeManager frm = new frmChargeTypeManager();
         LBShowForm.ShowMainPage(frm);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#22
0
 private void btnChangeBill_Click(object sender, EventArgs e)
 {
     try
     {
         frmSaleCarChangeBill frmChange = new frmSaleCarChangeBill(mlSaleCarInBillID, mlSaleCarOutBillID);
         LBShowForm.ShowDialog(frmChange);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#23
0
 private void btnAddItemType_Click(object sender, EventArgs e)
 {
     try
     {
         frmItemType frm = new frmItemType(0);
         LBShowForm.ShowDialog(frm);
         BuildTree();
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#24
0
 private void btnAddChangePriceBill_Click(object sender, EventArgs e)
 {
     try
     {
         frmModifyBillHeaderEdit frm = new frmModifyBillHeaderEdit(0);
         frm.PageAutoSize = true;
         LBShowForm.ShowDialog(frm);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#25
0
 private void Pic_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         PictureBox pb = sender as PictureBox;
         frmSaleCarInOutDisneyBigPicture frm = new frmSaleCarInOutDisneyBigPicture(pb.Image);
         LBShowForm.ShowDialog(frm);
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#26
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         frmUOM frm = new frmUOM(0);
         LBShowForm.ShowDialog(frm);
         LoadDataSource();
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#27
0
 private void BtnAddItemBase_Click(object sender, EventArgs e)
 {
     try
     {
         frmItemBase frmIB = new frmItemBase(0);
         LBShowForm.ShowDialog(frmIB);
         ReSearchData();
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
示例#28
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                frmEditBackUp frm = new frmEditBackUp(0);
                LBShowForm.ShowDialog(frm);

                LoadBackUpConfig();
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
示例#29
0
        private void btnAddCard_Click(object sender, EventArgs e)
        {
            try
            {
                frmCardEdit frmCard = new frmCardEdit(0);
                LBShowForm.ShowDialog(frmCard);

                PerformReturn();
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
示例#30
0
        private void btnEditReport_Click(object sender, EventArgs e)
        {
            try
            {
                long      lReportTemplateID = 0;
                DataTable dtReport          = ExecuteSQL.CallView(132, "ReportTemplateID", "ReportViewID=" + mlReportViewID, "");

                if (dtReport.Rows.Count > 0)
                {
                    lReportTemplateID = dtReport.Rows[0]["ReportTemplateID"].ToString() == "" ?
                                        0 : Convert.ToInt64(dtReport.Rows[0]["ReportTemplateID"]);
                }

                ReportRequestArgs args;
                args = new ReportRequestArgs(lReportTemplateID, 8, null, null);

                LBDbParameterCollection parmCol = new LBDbParameterCollection();
                parmCol.Add(new LBParameter("ReportViewID", enLBDbType.Int64, mlReportViewID));
                DataSet dsReturn;
                Dictionary <string, object> dictValue;
                ExecuteSQL.CallSP(14407, parmCol, out dsReturn, out dictValue);

                DataTable dtSource = null;
                if (dsReturn != null && dsReturn.Tables.Count > 0)
                {
                    dtSource           = dsReturn.Tables[0].Copy();
                    dtSource.TableName = "T008";
                    DataSet dsSource = new DataSet("Report");
                    dsSource.Tables.Add(dtSource);
                    args.DSDataSource     = dsSource;
                    args.ReportTemplateID = lReportTemplateID;
                    frmEditReport frm = new frmEditReport(args);
                    LBShowForm.ShowDialog(frm);

                    if (frm.ReportArgs != null &&
                        frm.ReportArgs.ReportTemplateID > 0)
                    {
                        parmCol = new LBDbParameterCollection();
                        parmCol.Add(new LBParameter("ReportViewID", enLBDbType.Int64, mlReportViewID));
                        parmCol.Add(new LBParameter("ReportTemplateID", enLBDbType.Int64, frm.ReportArgs.ReportTemplateID));
                        ExecuteSQL.CallSP(14406, parmCol, out dsReturn, out dictValue);
                    }
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }