private object UnitQtyChange_CustomCallback(CustomerActionEventArgs args) { this.DataCollect(); this.DataBinding(); ArrayList list = (ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows]; ArrayList lstAllData = (ArrayList)args.ArgsHash[this.DataGrid0.ClientID]; int colIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusColumn"]); //取列号 int rowIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusRow"]); //取行号 Hashtable hs = lstAllData[rowIndex] as Hashtable; if (list.Count != 0) { int rowIndexUI = int.Parse(list[0].ToString()); decimal unitQty = 0; if (hs["Dosage"] != null && string.IsNullOrEmpty(hs["Dosage"].ToString()) == false) { unitQty = decimal.Parse(hs["Dosage"].ToString()); } ReturnUpDownBrokerageDTOData dto = this.CurrentState["DTO"] as ReturnUpDownBrokerageDTOData; decimal demandQty = 0; if (dto != null) { demandQty = unitQty * dto.Qty; } UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid0); grid.CellValue.Add(new Object[] { rowIndex, "NeedNumber", new string[] { demandQty.ToString(), demandQty.ToString(), demandQty.ToString() } }); args.ArgsResult.Add(grid.ClientInstanceWithValue); } return(args); }
public object cF_DoCustomerAction(CustomerActionEventArgs args) { ArrayList list = (ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows]; ArrayList lstAllData = (ArrayList)args.ArgsHash[this.DataGrid5.ClientID]; int colIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusColumn"]); //取列号 int rowIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusRow"]); //取行号 Hashtable hs = lstAllData[rowIndex] as Hashtable; int num = Convert.ToInt32(hs["DiscountType"]); // UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid5); if (num == (int)AllEnumBE.DiscountTypeEnumData.FixedValues)//固定值 { //比例清空 不可以输入 grid.CellValue.Add(new Object[] { rowIndex, "Discount", new string[] { "0.0000%", "0.0000%", "0.0000%" } }); this.DataGrid5.Columns["Discount"].Enabled = false; this.DataGrid5.Columns["Prices"].Enabled = true; } else { //价格清空,不可输入 grid.CellValue.Add(new Object[] { rowIndex, "Prices", new string[] { "0", "0", "0" } }); this.DataGrid5.Columns["Prices"].Enabled = false; this.DataGrid5.Columns["Discount"].Enabled = true; } args.ArgsResult.Add(grid.ClientInstanceWithValue); return(args); }
private object RateChange_CustomCallback(CustomerActionEventArgs args) { this.DataCollect(); this.DataBinding(); ArrayList list = (ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows]; ArrayList lstAllData = (ArrayList)args.ArgsHash[this.DataGrid0.ClientID]; int colIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusColumn"]); //取列号 int rowIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusRow"]); //取行号 Hashtable hs = lstAllData[rowIndex] as Hashtable; if (list.Count != 0) { int rowIndexUI = int.Parse(list[0].ToString()); decimal rate = Convert.ToDecimal(hs["DiscountRate"]); decimal qty = Convert.ToDecimal(hs["SOLine_OrderByQtyTU"]); decimal exportPrice = Convert.ToDecimal(hs["ExportPrice"]); decimal FinallyPrice = exportPrice - exportPrice * rate; decimal money = exportPrice * qty - FinallyPrice * qty; decimal totalMoney = FinallyPrice * qty; UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid0); grid.CellValue.Add(new Object[] { rowIndex, "SOLine_FinallyPriceTC", new string[] { FinallyPrice.ToString(), FinallyPrice.ToString(), FinallyPrice.ToString() } }); grid.CellValue.Add(new Object[] { rowIndex, "CalAmount", new string[] { money.ToString(), money.ToString(), money.ToString() } }); grid.CellValue.Add(new Object[] { rowIndex, "DiscountMoney", new string[] { totalMoney.ToString(), totalMoney.ToString(), totalMoney.ToString() } }); args.ArgsResult.Add(grid.ClientInstanceWithValue); } return(args); }
private object CallBack_FDDocType_DoCustomerAction(CustomerActionEventArgs args) { UFSoft.UBF.UI.ControlModel.IUFFldReference f1 = (IUFFldReference)this.txtOrderOrg; object value = args.ArgsHash["u_M_p0_DFFSO_Global_14_Value"]; if (value != null) { UFIDA.U9.Cust.GS.FT.SoBP.CurrencyDtoData currecyDto = PubHelperUI.SOUIHelperExtend.GetCurrencyByOrg(value.ToString()); if (currecyDto != null) { SetSOCurrency(currecyDto); _strongPart.TC0_TextChanged(null, null); } } //if (part.Model.Views["SO"].FocusedRecord["DescFlexField_PrivateDescSeg14"] != null) //{ // UFIDA.U9.Cust.GS.FT.SoBP.CurrencyDtoData currecyDto = PubHelperUI.SOUIHelperExtend.GetCurrencyByOrg(part.Model.Views["SO"].FocusedRecord["DescFlexField_PrivateDescSeg14"].ToString()); // if (currecyDto != null) // { // SetSOCurrency(currecyDto); // _strongPart.TC0_TextChanged(null,null); // } //} part.DataCollect(); part.IsDataBinding = true; //通过args.ArgHash,取得控件值,可通过监视args.ArgsHash察看所含值 //callbackform中,通过ParameterControls.Add入的控件,才可用argshash得到其值 return(args); }
object DataGrid4_Price_OnCellDataChanged(CustomerActionEventArgs args) { if (DataGrid4 == null) { DataGrid4 = (IUFDataGrid)part.GetUFControlByName(part.TopLevelContainer, "DataGrid4"); } this.part.DataCollect(); this.part.DataBinding(); DataGrid4.BindData(); ArrayList list = (ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows]; ArrayList lstAllData = (ArrayList)args.ArgsHash[DataGrid4.ClientID]; int colIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusColumn"]); //取列号 int rowIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusRow"]); //取行号 Hashtable hs = lstAllData[rowIndex] as Hashtable; UFWebClientGridAdapter grid = new UFWebClientGridAdapter(DataGrid4); if (!String.IsNullOrEmpty(hs["OrderPriceTC"].ToString()) && decimal.Parse(hs["OrderPriceTC"].ToString()) > 0) { //定价 decimal price = String.IsNullOrEmpty(hs["OrderPriceTC"] + "") ? decimal.Zero : decimal.Parse(hs["OrderPriceTC"].ToString()); //外销价 decimal DescFlexField_PrivateDescSeg5 = String.IsNullOrEmpty(hs["DescFlexField_PrivateDescSeg5"] + "") ? decimal.Zero : decimal.Parse(hs["DescFlexField_PrivateDescSeg5"].ToString()); //如果无勾选特价,定价必须小于等于外销价 //如果勾选特价,外销价可以小于定价,也可以大于定价。。。 if (price > 0) { if (DescFlexField_PrivateDescSeg5 > 0) { if (price != DescFlexField_PrivateDescSeg5) { price = DescFlexField_PrivateDescSeg5; } } //if (String.IsNullOrEmpty(DescFlexField_PrivateDescSeg1) || "false".ToUpper().Equals(DescFlexField_PrivateDescSeg1.ToUpper())) //{ // if (DescFlexField_PrivateDescSeg5 >= price) // price = DescFlexField_PrivateDescSeg5; //} //else //{ // price = DescFlexField_PrivateDescSeg5; //} //行记录 grid.CellValue.Add(new Object[] { rowIndex, "DescFlexField_PrivateDescSeg5", new string[] { price.ToString(), price.ToString(), price.ToString() } }); } args.ArgsResult.Add(grid.ClientInstanceWithValue); } return(args); }
private object cF_DoCustomerAction(CustomerActionEventArgs args) { string detailMemo1 = string.Empty; //当前焦点行 int curIndex = Convert.ToInt32(args.ArgsHash[this.DataGrid5.ClientID + "_ALL_GRIDDATA_FocusRow"]); //当前行的所有值 Hashtable ht1 = (Hashtable)((ArrayList)args.ArgsHash[this.DataGrid5.ClientID])[curIndex]; decimal ThisCancelQty = Convert.ToDecimal(ht1["ThisCancelQty"]); //行上本次核销数量 decimal NotCancelQty = Convert.ToDecimal(ht1["NotCancelQty"]); //行上可核销数量 if (ThisCancelQty > NotCancelQty) { throw new Exception("当前本次核销数量必须小于可核销数量"); } return(args); }
private object RowInsert_CustomCallback(CustomerActionEventArgs args) { string curRowIndex = args.ArgsHash[UFWebClientGridAdapter.FocusRow].ToString(); ArrayList list = (ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows]; ArrayList lstAllData = (ArrayList)args.ArgsHash[this.DataGrid1.ClientID]; int colIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusColumn"]); //取列号 int rowIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusRow"]); //取行号 Hashtable hs = lstAllData[rowIndex] as Hashtable; UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid1); grid.CellValue.Add(new Object[] { curRowIndex, "NeedUom", new string[] { this.Model.OrderBomHead.FocusedRecord.DosageUnit.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Code.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Name.ToString() } }); grid.CellValue.Add(new Object[] { curRowIndex, "NeedUom_Round_Precision", new string[] { this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_Precision.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_Precision.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_Precision.ToString() } }); grid.CellValue.Add(new Object[] { curRowIndex, "NeedUom_Round_RoundType", new string[] { this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_RoundType.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_RoundType.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_RoundType.ToString() } }); grid.CellValue.Add(new Object[] { curRowIndex, "NeedUom_Round_RoundValue", new string[] { this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_RoundValue.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_RoundValue.ToString(), this.Model.OrderBomHead.FocusedRecord.DosageUnit_Round_RoundValue.ToString() } }); args.ArgsResult.Add(grid.ClientInstanceWithValue); return(args); }
private object RowInsert_CustomCallback(CustomerActionEventArgs args) { string curRowIndex = args.ArgsHash[UFWebClientGridAdapter.FocusRow].ToString(); ArrayList list = (ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows]; ArrayList lstAllData = (ArrayList)args.ArgsHash[this.DataGrid1.ClientID]; int colIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusColumn"]); //取列号 int rowIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusRow"]); //取行号 Hashtable hs = lstAllData[rowIndex] as Hashtable; UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid1); if (this.CurrentState["So_ID"] != null && this.CurrentState["So_DocNo"] != null) { long So_ID = Convert.ToInt64(this.CurrentState["So_ID"] + ""); grid.CellValue.Add(new Object[] { curRowIndex, "SellOrderID", new long[] { So_ID, So_ID, So_ID } }); grid.CellValue.Add(new Object[] { curRowIndex, "SellOrderRowNo", new string[] { this.CurrentState["So_DocNo"] + "", this.CurrentState["So_DocNo"] + "", this.CurrentState["So_DocNo"] + "" } }); // grid.CellValue.Add(new Object[] { curRowIndex, "CostMonery", new decimal[] { 3, 3, 3 } }); } args.ArgsResult.Add(grid.ClientInstanceWithValue); return(args); }
object DataGrid4_Price_OnCellDataChanged(CustomerActionEventArgs args) { this.DataCollect(); this.DataBinding(); this.DataGrid0.BindData(); ArrayList list = (ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows]; ArrayList lstAllData = (ArrayList)args.ArgsHash[this.DataGrid0.ClientID]; int colIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusColumn"]); //取列号 int rowIndex = Convert.ToInt32(args.ArgsHash["ALL_GRIDDATA_FocusRow"]); //取行号 Hashtable hs = lstAllData[rowIndex] as Hashtable; UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid0); int num = Convert.ToInt32(hs["BrokerageType"]);//类型 decimal DescFlexField_PrivateDescSeg30 = String.IsNullOrEmpty(hs["DescFlexField_PrivateDescSeg30"] + "") ? decimal.Zero : decimal.Parse(hs["DescFlexField_PrivateDescSeg30"].ToString()); if (num == (int)AllEnumBE.DiscountTypeEnumData.FixedValues)//固定值 { decimal price = String.IsNullOrEmpty(hs["Prices"].ToString()) ? decimal.Zero : decimal.Parse(hs["Prices"].ToString()); if (price < 0L || price > DescFlexField_PrivateDescSeg30) { grid.CellValue.Add(new Object[] { rowIndex, "price", new string[] { price.ToString(), price.ToString(), price.ToString() } }); args.ArgsResult.Add(grid.ClientInstanceWithValue); } } else if (num == (int)AllEnumBE.DiscountTypeEnumData.PercentValues)//百分比 { decimal BrokerageRatio = String.IsNullOrEmpty(hs["BrokerageRatio"].ToString()) ? decimal.Zero : decimal.Parse(hs["BrokerageRatio"].ToString()); if (BrokerageRatio < 0L || BrokerageRatio > DescFlexField_PrivateDescSeg30) { grid.CellValue.Add(new Object[] { rowIndex, "BrokerageRatio", new string[] { BrokerageRatio.ToString(), BrokerageRatio.ToString(), BrokerageRatio.ToString() } }); args.ArgsResult.Add(grid.ClientInstanceWithValue); } } return(args); }