Пример #1
0
		private void SaveRecord()
		{
			DebitMemoDetails clsDetails = new DebitMemoDetails();

			clsDetails.DebitMemoID = Convert.ToInt64(lblDebitMemoID.Text);
			clsDetails.MemoNo = lnkMemoNo.Text;
			clsDetails.MemoDate = Convert.ToDateTime(lblMemoDate.Text);
			clsDetails.SupplierID = Convert.ToInt64(cboSupplier.SelectedItem.Value);
			clsDetails.SupplierCode = cboSupplier.SelectedItem.Text;
			clsDetails.SupplierContact = txtSupplierContact.Text;
			clsDetails.SupplierAddress = txtSupplierAddress.Text;
			clsDetails.SupplierTelephoneNo = txtSupplierTelephoneNo.Text;
			switch (lblModeOfterms.Text)
			{
				case "Days":
					clsDetails.SupplierModeOfTerms = 0;
					break;
				case "Months":
					clsDetails.SupplierModeOfTerms = 1;
					break;
				case "Years":
					clsDetails.SupplierModeOfTerms = 2;
					break;
			}
			clsDetails.RequiredPostingDate = Convert.ToDateTime(txtRequiredPostingDate.Text);
			clsDetails.BranchID = Convert.ToInt16(cboBranch.SelectedItem.Value);
			clsDetails.PurchaserID = Convert.ToInt64(Session["UID"].ToString());
            clsDetails.PurchaserName = Session["Name"].ToString();
			clsDetails.DebitMemoStatus = DebitMemoStatus.Open;
			clsDetails.Remarks = txtRemarks.Text;

			DebitMemos clsDebitMemos = new DebitMemos();
			clsDebitMemos.Update(clsDetails);
			clsDebitMemos.CommitAndDispose();
		}