public static SampleStage[] LoadSampleStage(int buyerId) { DataTable dt = new DataTable(); List <SampleStage> sampleStage = new List <SampleStage>(); try { using (SmvEntryGateway smvGateway = new SmvEntryGateway()) { dt = smvGateway.LoadBuyerWiseSampleStage(buyerId); if (dt.Rows.Count > 0) { foreach (DataRow dtr in dt.Rows) { SampleStage sample = new SampleStage(); sample.SampleStageId = Convert.ToInt32(dtr["SampleStageId"].ToString()); sample.SampleStageName = dtr["SampleStageName"].ToString(); sampleStage.Add(sample); } } } } catch (Exception Ex) { } return(sampleStage.ToArray()); }
public int UpdateSampleStage(SampleStage sample) { try { OpenConnection(); ArrayList arlSqlParameter = new ArrayList(); arlSqlParameter.Add(new SqlParameter("@SampleStageId", sample.SampleStageId)); arlSqlParameter.Add(new SqlParameter("@SampleStageName", sample.SampleStageName)); arlSqlParameter.Add(new SqlParameter("@BuyerId", sample.BuyerId)); arlSqlParameter.Add(new SqlParameter("@IsActive", sample.IsActive)); arlSqlParameter.Add(new SqlParameter("@UpdatedBy", sample.UpdatedBy)); actionResult =this.ExecuteActionQuery("[kp].[USP_UpdateSampleStage]",arlSqlParameter); } catch(Exception ex) { } finally { CloseConnection(); } return actionResult; }
public DataTable InsertsampleStage(SampleStage sample) { DataTable dt = null; try { OpenConnection(); ArrayList arlSqlParameter = new ArrayList(); arlSqlParameter.Add(new SqlParameter("@SampleStageName", sample.SampleStageName)); arlSqlParameter.Add(new SqlParameter("@BuyerId", sample.BuyerId)); arlSqlParameter.Add(new SqlParameter("@IsActive", sample.IsActive)); arlSqlParameter.Add(new SqlParameter("@InsertedBy", sample.PostedBy)); arlSqlParameter.Add(new SqlParameter("@UpdatedBy", sample.UpdatedBy)); dt = this.ExecuteQuery("[kp].[USP_InsertSampleStage]", arlSqlParameter); } catch(Exception ex) { } finally { CloseConnection(); } return dt; }
protected void submitButton_Click(object sender, EventArgs e) { SampleStage sample = new SampleStage(); SampleStageBLL sampleBll = new SampleStageBLL(); DataTable dt = new DataTable(); try { sample.SampleStageName = sampleStageTextBox.Text; sample.BuyerId = Convert.ToInt32(buyerNameDropDownList.SelectedValue); sample.IsActive = Convert.ToInt32(isAcctiveDropDownList.SelectedValue); if (loadSampleId == 0) { sample.PostedBy = Convert.ToInt32(userId); sample.UpdatedBy = 0; dt = sampleBll.InsertSampleStage(sample); if (dt.Rows.Count > 0) { bool buyerName = Convert.ToBoolean(dt.Rows[0]["dBuyerName"]); bool sampleStage = Convert.ToBoolean(dt.Rows[0]["dSampleStage"]); if (buyerName && sampleStage) { messageLabel.Text = "<p Style ='font-size:20px;color:Red; margin-top:20px;'>(" + sample.SampleStageName + ") Already Exists For This Buyer</p>"; } else { messageLabel.Text = "<p Style ='font-size:20px;color:Green; margin-top:20px;'>New Sample Stage : " + sample.SampleStageName + " Created </p>"; sampleStageTextBox.Text = ""; buyerNameDropDownList.SelectedValue = "0"; isAcctiveDropDownList.SelectedValue = "0"; } } } else { sample.UpdatedBy = Convert.ToInt32(userId); sample.SampleStageId = loadSampleId; actionResult = sampleBll.UpdateSampleStageInfo(sample); if (actionResult == 1) { messageLabel.Text = "<p Style ='font-size:20px;color:Green; margin-top:20px;'>Updated has been successfully complete...</p>"; } else { messageLabel.Text = "<p Style ='font-size:20px;color:Red; margin-top:20px;'>Already Exists</p>"; } } table = loadSampleStage(); } catch (Exception ex) { } }
private async void Form1_Load(object sender, EventArgs e) { this.DoubleBuffered = true; label1.Text = "(" + GameMaster.Player.X + "," + GameMaster.Player.Y + ")"; var stage = new SampleStage(); nowStage = stage; stage.PreparationStage(); await nowStage.PlayStageAsync().ConfigureAwait(false); }
public int UpdateSampleStageInfo(SampleStage sample) { try { using (SampleStageGateway sampleStageGateway = new SampleStageGateway()) { actionResult = sampleStageGateway.UpdateSampleStage(sample); } } catch (Exception ex) { } return(actionResult); }
public DataTable InsertSampleStage(SampleStage sample) { DataTable dt = null; try { using (SampleStageGateway sampleStageGateway = new SampleStageGateway()) { dt = sampleStageGateway.InsertsampleStage(sample); } } catch (Exception ex) { } return(dt); }
// Use this for initialization void Start() { stage = new SampleStage(); GameStart(); }