private CostData[] readCostTextFile(string fileName) { int lc = 0; using (var streamReader = new StreamReader(fileName, System.Text.Encoding.Default)) { while (!streamReader.EndOfStream) { var line = streamReader.ReadLine(); lc++; } } cmd = new CostData[lc]; using (var streamReader = new StreamReader(fileName, System.Text.Encoding.Default)) { int i = 0; while (!streamReader.EndOfStream) { cmd[i] = new CostData(); var line = streamReader.ReadLine(); var valArray = line.Split(','); cmd[i].CostCode = Convert.ToString(valArray[0]); i++; } } return(cmd); }
private void returnValue(DataGridView dgv) { //ReturnValue = new string[dgv.ColumnCount]; //for (int i = 0; i < dgv.ColumnCount; i++) ReturnValue[i] = Convert.ToString(dgv.Rows[dgv.CurrentCellAddress.Y].Cells[i].Value); cmds = (CostData)cmd[dgv.CurrentCellAddress.Y].Clone(); this.Close(); }
private void loadCostMasterData(DataGridViewRow dgvRow, CostData cmds) { dgvRow.Cells["CostCode"].Value = cmds.CostCode; dgvRow.Cells["Item"].Value = cmds.Item; dgvRow.Cells["ItemDetail"].Value = cmds.ItemDetail; dgvRow.Cells["Unit"].Value = cmds.Unit; dgvRow.Cells["UnitPrice"].Value = decFormat(cmds.Cost); dgvRow.Cells["CostID"].Value = cmds.CostID; }
private void NewCost_Click(object sender, RoutedEventArgs e) { this.DataContext = CurrentCost = new CostData(); action = Actions.Inserting; txtAmount.Text = ""; txtInfo.Text = ""; cmbCosts.SelectedIndex = 0; rdCash.IsChecked = true; cmbCosts.IsEnabled = true; }
private decimal getCostData(string officeCode, string itemCode) { CostData cd = new CostData(); cd = cd.SelectCostMaster(itemCode, officeCode); if (cd == null) { return(0); } return(cd.Cost); }
// 原価マスタデータを得る private void chooseCostMasterData(int lNo) { CostData cmds = FormCostList.ReceiveItems(cmd); if (cmds == null) { return; } loadCostMasterData(dataGridView1.Rows[lNo], cmds); }
public string GetJewelryType(int id) { JewelryType jewelryType = db.JewelryTypes.Find(id); if (jewelryType == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } CostData cd = new CostData(); cd.companyId = jewelryType.CompanyId.Value; // two dictionaries, one for each market & multiplier Dictionary <string, decimal> metalMarketPrice = new Dictionary <string, decimal>(); // one for each metal type Dictionary <string, float> metalMultiplier = new Dictionary <string, float>(); // one for each metal type // assign market and multiplier for each metalcode // Metal Costs foreach (MetalCode m in db.MetalCodes.Where(x => x.CompanyId == jewelryType.CompanyId)) // add company ID!!! { // Metal Market Price if (cd.metalMarketPrice.Where(k => k.Key == m.Code).Count() == 0) { cd.metalMarketPrice.Add(m.Code, m.Market); } // Metal Multiplier if (cd.metalMultiplier.Where(k => k.Key == m.Code).Count() == 0) { cd.metalMultiplier.Add(m.Code, m.Multiplier); } } //if (!jewelryType.bUseLaborTable) { // Finishing and Packaging Costs foreach (JewelryType j in db.JewelryTypes.Where(x => x.CompanyId == jewelryType.CompanyId)) { // Finishing Costs: per Jewelry Type if (cd.finishingCosts.Where(k => k.Key == j.Name).Count() == 0) { cd.finishingCosts.Add(j.Name, j.FinishingCost); } // Packaging Costs: per Jewelry Type if (cd.packagingCosts.Where(k => k.Key == j.Name).Count() == 0) { cd.packagingCosts.Add(j.Name, j.PackagingCost); } } } JewelryTypeJSON jt = new JewelryTypeJSON(jewelryType, cd); string json = JsonConvert.SerializeObject(jt); return(json); }
private bool selectCostMaster(string costCode) { CostData cdp = new CostData(); cdp = cdp.SelectCostMaster(costCode, Convert.ToString(comboBoxOffice.SelectedValue)); if (cdp == null) { return(false); } dispSubcontractor(cdp); return(true); }
private void EditCost_Click(object sender, RoutedEventArgs e) { var cost = ((FrameworkElement)sender).DataContext as CostData; CurrentCost = cost; action = Actions.Editing; txtAmount.Value = cost.Amount; txtInfo.Text = cost.Info; cmbCosts.SelectedValue = cost.CostId; PaymentDialogHost.IsOpen = true; cmbCosts.IsEnabled = false; }
private void readyDataArray() { int daysInMonth = DateTime.DaysInMonth(procDate.Year, procDate.Month); dayArray = new DateTime[daysInMonth]; dowArray = new int[daysInMonth]; hdayArray = new int[daysInMonth]; workHArray = new decimal[dataGridView1.RowCount, daysInMonth]; overHArray = new decimal[dataGridView1.RowCount, daysInMonth]; checkArray = new int[dataGridView1.RowCount, daysInMonth]; CalendarData cap = new CalendarData(); procDate.BeginOfMonth(); for (int i = 0; i < daysInMonth; i++) { dayArray[i] = procDate.AddDays(i); dowArray[i] = ( int )dayArray[i].DayOfWeek; hdayArray[i] = cap.ExitstenceHoliday(dayArray[i]) ? 1 : 0; } WorkReportData wrp = new WorkReportData(); CostData cdp = new CostData(); for (int i = 0; i < dataGridView1.Rows.Count; i++) { string wkMCode = Convert.ToString(dataGridView1.Rows[i].Cells["MemberCode"].Value); cdp = new CostData(); cdp = cdp.SelectCostMaster(Convert.ToString(dataGridView1.Rows[i].Cells["MemberCode"].Value), Convert.ToString(comboBoxOffice.SelectedValue), "A"); decimal[] workHour; for (int j = 0; j < dayArray.Length; j++) { workHour = wrp.SelectSummaryWorkReport(Convert.ToString(dataGridView1.Rows[i].Cells["MemberCode"].Value), dayArray[j]); workHArray[i, j] = workHour[0]; overHArray[i, j] = workHour[1]; checkArray[i, j] = ( int )workHour[2]; if (cdp != null && cdp.Unit == "時間") { if (workHour[0] > 0) { workHArray[i, j] = workHour[0] / 8; } } } } curNo = 0; displayWorkingData(dataGridView1, curNo); }
private void chooseCostData() { if (cost == null) { MessageBox.Show("対象となる原価データはありません"); return; } CostData dcost = FormCostListSimple.ReceiveItems(cost); if (dcost == null) { return; } dispCostData(dcost); }
private bool dispCostMaster(DataGridViewRow dgvRow, string costCode, string officeCode) { SqlHandling sql = new SqlHandling("M_Cost"); DataTable dt; if ((dt = sql.SelectAllData("WHERE CostCode = '" + costCode + "' AND OfficeCode = '" + officeCode + "'")) == null) { return(false); } DataRow dr = dt.Rows[0]; CostData cmds = new CostData(dr); loadCostMasterData(dgvRow, cmds); return(true); }
private List <string> LoadRecyclerParts() { var ret = new List <string>(); totVol = 0; totMass = 0; totParts = 0; totCost = new List <CostData>(); var inv = _module.part.FindModuleImplementing <ModuleInventoryPart>(); for (int z = 0; z < inv.InventorySlots; z++) { if (!inv.IsSlotEmpty(z)) { var invPart = GetPartByName(inv.storedParts[z].partName); ret.Add(invPart.title); totParts++; totVol += invPart.partPrefab.FindModuleImplementing <ModuleCargoPart>().packedVolume; totMass += invPart.partPrefab.mass; totMass += invPart.partPrefab.resourceMass; //Add our cost data var cost = PartUtilities.GetPartCost(invPart, _persistence); foreach (var c in cost) { var cTot = totCost.Where(x => x.Resource.name == c.Resource.name).FirstOrDefault(); if (cTot == null) { cTot = new CostData(); cTot.Resource = c.Resource; totCost.Add(cTot); } cTot.Quantity += c.Quantity; } } } //Account for recycle ratio foreach (var cost in totCost) { double adjQuantity = Math.Floor(cost.Quantity * _module.DekonstructRatio); cost.Quantity = (int)adjQuantity; } ret.Sort(); return(ret); }
private void chooseCostData(DataGridViewRow dgvRow) { if (cmd == null) { return; } CostData cmds = FormCostList.ReceiveItems(cmd); if (cmds == null) { return; } // cmdsからtcdを作り直す場合は次の2Lineのコメントを外す。 //ListFormDataOp lo = new ListFormDataOp(); //tcd = lo.SelectTaskCodeNameFromOsWkReport( cmds.CostCode, dateTimePickerEx1.Value ); dispCostData(cmds, dgvRow); }
// GET api/<controller>/5 public string Get(int companyId) { CostData cd = new CostData(); // two dictionaries, one for each market & multiplier Dictionary <string, decimal> metalMarketPrice = new Dictionary <string, decimal>(); // one for each metal type Dictionary <string, float> metalMultiplier = new Dictionary <string, float>(); // one for each metal type // assign market and multiplier for each metalcode // Metal Costs foreach (MetalCode m in db.MetalCodes.Where(x => x.CompanyId == companyId)) // add company ID!!! { // Metal Market Price if (cd.metalMarketPrice.Where(k => k.Key == m.Code).Count() == 0) { cd.metalMarketPrice.Add(m.Code, m.Market); } // Metal Multiplier if (cd.metalMultiplier.Where(k => k.Key == m.Code).Count() == 0) { cd.metalMultiplier.Add(m.Code, m.Multiplier); } } // Finishing and Packaging Costs foreach (JewelryType jt in db.JewelryTypes.Where(x => x.CompanyId == companyId)) { // Finishing Costs: per Jewelry Type if (cd.finishingCosts.Where(k => k.Key == jt.Name).Count() == 0) { cd.finishingCosts.Add(jt.Name, jt.FinishingCost); } // Packaging Costs: per Jewelry Type if (cd.packagingCosts.Where(k => k.Key == jt.Name).Count() == 0) { cd.packagingCosts.Add(jt.Name, jt.PackagingCost); } } string costDataJSON = cd.GetJSON(); return(costDataJSON); }
private void editDgvRow(DataGridViewRow dgvRow, TaskCodeNameData tcnd, string itemIni) { CostReportData crdp = new CostReportData(); CostData cd = new CostData(); int[] monthArray = new int[] { 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3 }; int year = Convert.ToInt32(comboBoxFY.Text); decimal cost = 0M; decimal costSum = 0M; dgvRow.Cells["TaskCode"].Value = tcnd.TaskCode; dgvRow.Cells["PartnerName"].Value = tcnd.Partner; dgvRow.Cells["TaskName"].Value = tcnd.TaskName; for (int i = 0; i < monthArray.Length; i++) { cost = crdp.SumMonthlyCost(tcnd.TaskCode, Conv.OfficeCode, DateTime.ParseExact(Convert.ToString(year * 10000 + monthArray[i] * 100 + 1), "yyyyMMdd", null)); dgvRow.Cells["Cost" + i.ToString("00")].Value = decFormat(cost); costSum += cost; costArray[i] += cost; } dgvRow.Cells["CostSum"].Value = decFormat(costSum); costSum = 0; }
/// <summary> /// 最短経路を探す. /// </summary> /// <returns>The saitan.</returns> /// <param name="nodeMap">Node map.</param> /// <param name="startKey">Start key.</param> /// <param name="goalKey">Goal key.</param> /// <param name="loopout">計算を諦めるしきい値</param> /// <param name="costDict">Cost dict.</param> /// <param name="route">Route.</param> public static int GetShortestRoute(NodeMap nodeMap, string startKey, string goalKey, int loopout, out CostDict costDict, out LinkedList <string> route) { costDict = new CostDict(nodeMap.nodeMap.Count); var stack = new SortedSet <CostDataForStack>(new CostDataForStack.myReverserClass()); var startNode = nodeMap.nodeMap[startKey]; var goalNode = nodeMap.nodeMap[goalKey]; { var openNodeCostData = new CostData { cost = 0.0f, heuristicCost = Vector3.Distance(startNode.Position, goalNode.Position), parent = null }; costDict[startKey] = openNodeCostData; CostDataForStack costDataForStack = new CostDataForStack { cost = openNodeCostData.cost, score = openNodeCostData.cost + openNodeCostData.heuristicCost, nodeName = startKey }; stack.Add(costDataForStack); } while (stack.Count != 0 && 0 < loopout) { loopout--; var parent = stack.First(); stack.Remove(parent); var parentName = parent.nodeName; var parentNode = nodeMap.nodeMap[parentName]; var parentCost = costDict[parentName]; foreach (var openNodeName in parentNode.Graph) { if (costDict.ContainsKey(openNodeName)) { continue; } var openNode = nodeMap.nodeMap[openNodeName]; var openNodeCost = parentCost.cost + Vector3.Distance(openNode.Position, parentNode.Position); var hCost = Vector3.Distance(openNode.Position, goalNode.Position); var openNodeCostData = new CostData { cost = openNodeCost, heuristicCost = hCost, parent = parentName }; var costDataForStack = new CostDataForStack { cost = openNodeCostData.cost, score = openNodeCostData.cost + openNodeCostData.heuristicCost, nodeName = openNodeName }; costDict[openNodeName] = openNodeCostData; stack.Add(costDataForStack); CostDataForStack.Dump(costDataForStack); } if (costDict.ContainsKey(goalKey)) { break; } } if (costDict.ContainsKey(goalKey)) { route = new LinkedList <string>(); var node = costDict[goalKey]; while (node.parent != null) { route.AddFirst(node.parent); node = costDict[node.parent]; } return(route.Count); } else { route = null; return(0); } }
private void dispSubcontractor(CostData cmds) { textBoxItem.Text = cmds.Item.Replace("(支払い)", ""); labelItemCode.Text = cmds.CostCode; }
private bool editData(StreamReader stR, string bookName) { bool first = true; string dataType; int lno = 0; int cntK = 0, cntK1 = 0, cntL = 0; int cntA = 0, cntB = 0, cntC = 0, cntG = 0, cntD = 0, cntD1 = 0; //TaskData td = new TaskData(); //TaskIndData tid = new TaskIndData(); CostData cd; while (!stR.EndOfStream) { var line = stR.ReadLine(); var valArray = line.Split(','); if (first) { wrep.ReportDate = Convert.ToDateTime(valArray[0]); wrep.TaskCode = Convert.ToString(valArray[3]); wrep.Note = Convert.ToString(valArray[6]); wrep.Author = Convert.ToString(valArray[7]); wrep.OfficeCode = Convert.ToString(valArray[11]); wrep.Department = Convert.ToString(valArray[12]); wrep.PartnerCode = Convert.ToString(valArray[2]); // 協力会社コードFXXX wrep.PartnerName = Convert.ToString(valArray[1]); // 協力会社名 wrep.ContractForm = 1; wrep.PNo = Convert.ToInt32(valArray[13]); wrep.TotalP = Convert.ToInt32(valArray[14]); wrep.CoTaskCode = ""; if (valArray.Length > 15) { wrep.CoTaskCode = String.IsNullOrEmpty(Convert.ToString(valArray[15])) ? "" : Convert.ToString(valArray[15]); } //wrep.CoTaskCode = Convert.ToString(valArray[15]) ; TaskData td = new TaskData(); //td = td.SelectTaskData(wrep.TaskCode); td = td.SelectTaskData((wrep.CoTaskCode == "") ? wrep.TaskCode : wrep.CoTaskCode); wrep.SalesMCode = td.SalesMCode; wrep.CustoCode = td.PartnerCode; TaskIndData tid = new TaskIndData(); //string tempTaskCd = (wrep.CoTaskCode == "") ? wrep.TaskCode : wrep.CoTaskCode; //tid = tid.SelectTaskIndData(wrep.TaskCode); tid = tid.SelectTaskIndData((wrep.CoTaskCode == "") ? wrep.TaskCode : wrep.CoTaskCode); //wrep.OfficeCode = tid.OfficeCode; wrep.LeaderMCode = tid.LeaderMCode; int volLine = Convert.ToInt32(valArray[8]); int costLine = Convert.ToInt32(valArray[9]); int costBLine = Convert.ToInt32(valArray[10]); wdtl = new OsWkDetailData[volLine * 3 + costLine * 4 + costBLine * 2]; first = false; } else { wdtl[lno] = new OsWkDetailData(); dataType = Convert.ToString(valArray[0]); if (Convert.ToString(valArray[1]) == "" || Convert.ToString(valArray[1]) == null) { wdtl[lno].ItemCode = ""; lno++; continue; } wdtl[lno].ItemCode = Convert.ToString(valArray[1]); wdtl[lno].Item = Convert.ToString(valArray[2]); // Get CostData cd = new CostData(); cd = cd.SelectCostMaster(wdtl[lno].ItemCode, wrep.OfficeCode); wdtl[lno].Cost = (cd == null) ? 0M : cd.Cost; if (Convert.ToString(valArray[5]) != "") { wdtl[lno].Quantity = Convert.ToDecimal(valArray[5]); } wdtl[lno].Unit = (valArray[6] == "") ? "式" : Convert.ToString(valArray[6]); if (dataType != "K1") { //wdtl[lno].Unit = (valArray[6] == "") ? "": Convert.ToString(valArray[6]); wdtl[lno].Subject = dataType; wdtl[lno].ItemDetail = ""; wdtl[lno].Range = ""; } switch (dataType) { case "K": wdtl[lno].LNo = cntK; cntK++; break; case "K1": wdtl[lno].ItemDetail = Convert.ToString(valArray[3]); wdtl[lno].Range = Convert.ToString(valArray[4]); wdtl[lno].Subject = "K"; //wdtl[lno].Unit = ""; wdtl[lno].LNo = cntK1; cntK1++; break; case "L": wdtl[lno].LNo = cntL; cntL++; break; case "A": // costget wdtl[lno].LNo = cntA; cntA++; break; case "D": wdtl[lno].LNo = cntD; cntD++; break; case "C": wdtl[lno].LNo = cntC; cntC++; break; case "G": wdtl[lno].LNo = cntG; cntG++; break; case "B": //costget wdtl[lno].LNo = cntB; cntB++; break; case "D1": wdtl[lno].Subject = "D"; wdtl[lno].LNo = cntD1; cntD1++; break; default: break; } wdtl[lno].RecType = (dataType == "K" || dataType == "K1" || dataType == "L") ? 0 : 1; lno++; } } stR.Close(); return(true); }
private void chooseCostData() { if (cmd == null) { MessageBox.Show("対象となる原価データはありません"); return; } CostData cmds = FormCostList.ReceiveItems(cmd); if (cmds == null) { return; } dispSubcontractor(cmds); // カレントディレクトリを指定された原価コード名称のフォルダーとする。ただし存在しなければ作成する。 //folderName = Folder.MyDocuments() + @"\" + labelItemCode.Text + textBoxItem.Text; //folderName = @"C:\WorkReport\" + labelItemCode.Text + textBoxItem.Text; folderName = @"C:\WorkReport\" + Convert.ToString(comboBoxOffice.SelectedValue) + Convert.ToString(comboBoxDepart.SelectedValue) + labelItemCode.Text + textBoxItem.Text; if (!System.IO.Directory.Exists(folderName)) { Func <DialogResult> dialogCreateFolder = DMessage.DialogCreateFolder; if (dialogCreateFolder() == DialogResult.No) { return; } System.IO.Directory.CreateDirectory(folderName); MessageBox.Show("'" + folderName + "'を作成しました。"); Folder.CopyFolder(Folder.MyDocuments() + appFolder, folderName + binFolder, true); //Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(Folder.MyDocuments() + appFolder, folderName + binFolder, // Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing); ///// Create Shortcut string shortcutPath = System.IO.Path.Combine(folderName, labelItemCode.Text + textBoxItem.Text + @"内訳書入力.lnk"); //string targetPath = folderName + appFolder + sourceApp; string targetPath = folderName + binFolder + sourceApp; // WshShellを作成 Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); dynamic shell = Activator.CreateInstance(t); // WshShortcutを作成 var shortcut = shell.CreateShortcut(shortcutPath); // リンク先 shortcut.TargetPath = targetPath; //shortcut.WorkingDirectory = folderName + appFolder + @"\Release"; shortcut.WorkingDirectory = folderName + binFolder + @"\Release"; // ショートカットを作成 shortcut.Save(); // 後始末 System.Runtime.InteropServices.Marshal.FinalReleaseComObject(shortcut); System.Runtime.InteropServices.Marshal.FinalReleaseComObject(shell); } if (!System.IO.File.Exists(folderName + partnerFile)) { writeSubcontractFile(); } checkExistingTaskData(); checkExistingCostData(); }
private void dispCostData(CostData cmds) { textBoxItem.Text = cmds.CostCode; labelItem.Text = cmds.Item; }
public async Task <HttpResponseMessage> loadCostData([FromBody] int id) { var organId = Convert.ToInt32(SecurityManager.CurrentUserContext.OrganizationId); var resualt = new CostData(); List <ContactVM> contacts = new List <ContactVM>(); ContactRule contactRule = new ContactRule(); var contactsSource = await contactRule.GetAllByOrganIdAsync(Convert.ToInt32(organId)); contactsSource = contactsSource.ToList(); contacts = Mapper.Map <IList <Contact>, List <ContactVM> >(contactsSource); foreach (var contact in contacts) { contact.DetailAccount = new DetailAccount() { Code = contact.Code, Id = (int)contact.ID, Node = new Node() { FamilyTree = "اشخاص", Id = (int)contact.ID, Name = "اشخاص" } }; //var account1104 = await CalcAccountByCodeTafziliAsync(organId, "1104" + contact.Code); //var account1105 = await CalcAccountByCodeTafziliAsync(organId, "1105" + contact.Code); //var account2101 = await CalcAccountByCodeTafziliAsync(organId, "2101" + contact.Code); //contact.Balance = account1104.sumTotal + account1105.sumTotal + account2101.sumTotal; //contact.Credits = account1104.sumCredit + account1105.sumCredit + account2101.sumCredit; //contact.Liability = account1104.sumDebit + account1105.sumDebit + account2101.sumDebit; } resualt.contacts = contacts; resualt.costSettings = new InvoiceSettings() { allowApproveWithoutStock = false, autoAddTax = true, bottomMargin = "20", businessLogo = "", font = "Iransans", fontSize = "Medium", footerNote = "", footerNoteDraft = "", hideZeroItems = false, onlineInvoiceEnabled = false, pageSize = "A4portrait", payReceiptTitle = "رسید پرداخت وجه / چک", purchaseInvoiceTitle = "فاکتور خرید", receiveReceiptTitle = "رسید دریافت وجه / چک", rowPerPage = "18", saleDraftInvoiceTitle = "پیش فاکتور", saleInvoiceTitle = "صورتحساب فروش کالا و خدمات", showAmountInWords = false, showCustomerBalance = false, showItemUnit = false, showSignaturePlace = true, showTransactions = true, showVendorInfo = true, topMargin = "10", updateBuyPrice = false, updateSellPrice = false }; AccountRule accountRule = new AccountRule(); List <DomainClasses.Accounting.Account> accounts = await accountRule.GetAllByOrganIdAsync(organId); var parentAccount = accounts.Where(x => x.ComplteCoding == "8205").SingleOrDefault(); accounts = accounts.Where(x => x.ParentId == parentAccount.ID).ToList(); resualt.items = accounts; var CostItems = new List <CostItemVM>(); if (id == 0) { CostItems.Add(new CostItemVM() { Description = "", ID = 0, RowNumber = 0, Sum = 0, Rest = 0 }); CostItems.Add(new CostItemVM() { Description = "", ID = 0, RowNumber = 1, Sum = 0, Rest = 0 }); CostItems.Add(new CostItemVM() { Description = "", ID = 0, RowNumber = 2, Sum = 0, Rest = 0 }); CostItems.Add(new CostItemVM() { Description = "", ID = 0, RowNumber = 3, Sum = 0, Rest = 0 }); resualt.cost = new CostVM() { Contact = null, ContactTitle = "", DateTime = DateTime.Now, DisplayDate = PersianDateUtils.ToPersianDate(DateTime.Now), ID = 0, CostItems = CostItems, Number = await createNumberCost(organId), Paid = 0, Payable = 0, Rest = 0, Status = 0, Sum = 0, Explain = "" }; } else { CostRule costRule = new CostRule(); var cost = await costRule.FindAsync(id); foreach (var costItem in cost.CostItems ?? new List <CostItem>()) { CostItems.Add(new CostItemVM() { Description = costItem.Description, ID = costItem.ID, RowNumber = costItem.RowNumber, Sum = costItem.Sum, Rest = costItem.Rest, Item = accounts.Where(x => x.ID == costItem.ItemId).SingleOrDefault(), ItemId = costItem.ItemId }); } var contact = new Contact(); if (cost.ContactId > 0) { contact = await this.Rule.UnitOfWork.RepositoryAsync <Contact>().Queryable().Where(x => x.ID == cost.ContactId).SingleOrDefaultAsync2(); } resualt.cost = new CostVM() { Contact = Mapper.Map <Contact, ContactVM>(contact), ContactTitle = contact.Name, DateTime = cost.DateTime, DisplayDate = cost.DisplayDate, ID = cost.ID, CostItems = CostItems, Number = cost.Number, Paid = cost.Paid, Payable = cost.Payable, Rest = cost.Rest, Status = cost.Status, Sum = cost.Sum, Explain = cost.Explain }; return(Request.CreateResponse(HttpStatusCode.OK, new { resualtCode = (int)ZhivarEnums.ResultCode.Successful, data = resualt })); } return(Request.CreateResponse(HttpStatusCode.OK, new { resualtCode = (int)ZhivarEnums.ResultCode.Successful, data = resualt })); }
//private bool selectCostMaster( string costCode ) //{ // CostData cdp = new CostData(); // cdp = cdp.SelectCostMaster( costCode, Convert.ToString( comboBoxOffice.SelectedValue ) ); // if( cdp == null ) return false; // return true; //} private void dispCostData(CostData cmds, DataGridViewRow dgvRow) { dgvRow.Cells["ItemCode"].Value = cmds.CostCode; dgvRow.Cells["Item"].Value = cmds.Item.Replace("(支払い)", "");; }
private void returnValue(DataGridView dgv) { cmds = (CostData)cmd[dgv.CurrentCellAddress.Y].Clone(); this.Close(); }
public JewelryTypeJSON(JewelryType jewelryType, CostData cd) { id = jewelryType.Id; bUseLaborTable = jewelryType.bUseLaborTable; costData = cd; }