private void LoadRecord() { Int16 iID = Convert.ToInt16(Common.Decrypt(Request.QueryString["id"], Session.SessionID)); StockTypes clsStockType = new StockTypes(); StockTypesDetails clsDetails = clsStockType.Details(iID); clsStockType.CommitAndDispose(); lblStockTypeID.Text = clsDetails.StockTypeID.ToString(); txtStockTypeCode.Text = clsDetails.StockTypeCode; txtDescription.Text = clsDetails.Description; cboDirection.SelectedIndex = cboDirection.Items.IndexOf(cboDirection.Items.FindByValue(clsDetails.StockDirection.ToString("d"))); }
private void SaveRecord() { StockTypes clsStockType = new StockTypes(); StockTypesDetails clsDetails = new StockTypesDetails(); clsDetails.StockTypeID = Convert.ToInt16(lblStockTypeID.Text); clsDetails.StockTypeCode = txtStockTypeCode.Text; clsDetails.Description = txtDescription.Text; clsDetails.StockDirection = (StockDirections)Enum.Parse(typeof(StockDirections), cboDirection.SelectedItem.Value); clsStockType.Update(clsDetails); clsStockType.CommitAndDispose(); }
private Int32 SaveRecord() { StockTypes clsStockType = new StockTypes(); StockTypesDetails clsDetails = new StockTypesDetails(); clsDetails.StockTypeCode = txtStockTypeCode.Text; clsDetails.Description = txtDescription.Text; clsDetails.StockDirection = (StockDirections)Enum.Parse(typeof(StockDirections), cboDirection.SelectedItem.Value); int id = clsStockType.Insert(clsDetails); clsStockType.CommitAndDispose(); return(id); }