private void DoSave() { try { var data = new roletbl { roleName = TxtRoleName.Text, description = TxtDescription.Text, creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = roleControl.AddData(data); ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } catch (Exception ex) { LogHelpers.source = this.GetType().Name; LogHelpers.message = ex.InnerException.ToString(); LogHelpers.user = ""; LogHelpers.WriteLog(); Alert("Gagal menyimpan data"); } }
private void DoSave() { var data = new parameterstbl { string0 = TxtString0.Text != "" ? TxtString0.Text : "", string1 = TxtString1.Text != "" ? TxtString1.Text : "", string2 = TxtString2.Text != "" ? TxtString2.Text : "", string3 = TxtString3.Text != "" ? TxtString3.Text : "", string4 = TxtString4.Text != "" ? TxtString4.Text : "", string5 = TxtString5.Text != "" ? TxtString5.Text : "", string6 = TxtString6.Text != "" ? TxtString6.Text : "", string7 = TxtString7.Text != "" ? TxtString7.Text : "", string8 = TxtString8.Text != "" ? TxtString8.Text : "", string9 = TxtString9.Text != "" ? TxtString9.Text : "", creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = parameterControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoSave() { string id = TxtOrderNo.Text; var data = new ordermastertbl { orderNo = id, customerNo = ParseInt(TxtCustomerNo.SelectedValue), comodityNo = ParseInt(TxtComodityNo.SelectedValue), sampleTotal = ParseInt(TxtSampleTotal.Text), priceTotal = Formater.ToNumber(TxtPriceTotal.Text), status = TxtStatus.Text, isPaid = TxtIsPayed.SelectedValue, ApprEvaluator = TxtIsApprove.SelectedValue, creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; if (TxtPic.SelectedValue != "-1") { data.pic = ParseInt(TxtPic.SelectedValue); } var ret = orderControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoUpdate() { int id = 0; int.TryParse(TxtParameterNo.Text, out id); var data = new parameterstbl { parametersNo = id, string0 = TxtString0.Text != "" ? TxtString0.Text : "", string1 = TxtString1.Text != "" ? TxtString1.Text : "", string2 = TxtString2.Text != "" ? TxtString2.Text : "", string3 = TxtString3.Text != "" ? TxtString3.Text : "", string4 = TxtString4.Text != "" ? TxtString4.Text : "", string5 = TxtString5.Text != "" ? TxtString5.Text : "", string6 = TxtString6.Text != "" ? TxtString6.Text : "", string7 = TxtString7.Text != "" ? TxtString7.Text : "", string8 = TxtString8.Text != "" ? TxtString8.Text : "", string9 = TxtString9.Text != "" ? TxtString9.Text : "", modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; var ret = parameterControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoUpdate() { string id = TxtOrderDetailNo.Text; var data = new orderanalysisdetailtbl { orderDetailNo = ParseInt(id), orderNo = TxtOrderNo.SelectedValue, sampleNo = TxtSampleNo.SelectedValue, elementId = Convert.ToInt32(TxtElementCode), parametersNo = ParseInt(TxtParametersNo.Text), elementValue = TxtElementValue.Text, status = TxtStatus.SelectedValue, recalculate = TxtRecalculate.SelectedValue, modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; if (TxtPic.SelectedValue != "-1") { data.pic = ParseInt(TxtPic.SelectedValue); } var ret = detailControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoUpdate() { int id = ParseInt(TxtComodityNo.Text); var data = new comoditytbl { comodityNo = id, comodityName = TxtComodityName.Text, derivativeTo = ParseInt(TxtDerivativeTo.SelectedValue), description = TxtDescription.Text, modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; var ret = comodityControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoUpdate() { int id = 0; int.TryParse(TxtStdId.Text, out id); var data = new standarddetailtbl { stdDetailId = id, stdId = ParseInt(TxtStdId.SelectedValue), elementId = Convert.ToInt32(TxtElementCode.SelectedValue), modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; var ret = standardDetailControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoSave() { var data = new employeetbl { employeeName = TxtEmployeeName.Text, position = TxtPosition.Text, employeeEmail = TxtEmpEmail.Text, derivativeToEmployee = ParseInt(TxtDerivativeEmp.SelectedValue), creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; if (TxtAccountNo.SelectedValue != "-1") { data.accountNo = ParseInt(TxtAccountNo.SelectedValue); } var ret = employeeControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoUpdate() { int id = 0; int.TryParse(TxtStdId.Text, out id); var data = new standardtbl { stdId = id, stdNo = TxtStdNo.Text, comodityNo = ParseInt(TxtComodityNo.SelectedValue), modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; if (TxtComodityNo.SelectedValue == "-1") { data.comodityNo = null; } var ret = standardControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoUpdate() { int id = ParseInt(TxtAccountNo.Text); var data = new accounttbl { accountNo = id, username = TxtUsername.Text, password = Crypto.Encrypt(TxtPassword.Text), roleName = TxtRoleName.SelectedValue, modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; var ret = accountControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoSave() { var data = new standardtbl { stdNo = TxtStdNo.Text, comodityNo = ParseInt(TxtComodityNo.SelectedValue), creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; if (TxtComodityNo.SelectedValue == "-1") { data.comodityNo = null; } var ret = standardControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoSave() { var data = new elementservicestbl { elementCode = TxtElementCode.Text, analysisTypeName = TxtAnalysisTypeName.SelectedValue, serviceGroup = TxtServiceGroup.Text ?? "", serviceRate = Formater.ToNumber(TxtServiceRate.Text), serviceStatus = TxtServiceStatus.SelectedValue, creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = elementServicesControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoUpdate() { string id = TxtElementCode.Text; var data = new elementservicestbl { elementCode = TxtElementCode.Text, analysisTypeName = TxtAnalysisTypeName.SelectedValue, serviceGroup = TxtServiceGroup.Text ?? "", serviceRate = Formater.ToNumber(TxtServiceRate.Text), serviceStatus = TxtServiceStatus.SelectedValue, modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; var ret = elementServicesControl.UpdateData(id, data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoSave() { var data = new customertbl { customerName = TxtCustomerName.Text, customerEmail = TxtCusEmail.Text, companyName = TxtCompanyName.Text, companyAddress = TxtCompanyAddress.Text, companyPhone = TxtPhoneNo.Text, companyEmail = TxtComEmail.Text, accountNo = ParseInt(TxtAccountNo.SelectedValue), creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; if (TxtAccountNo.SelectedValue != "-1") { data.accountNo = ParseInt(TxtAccountNo.SelectedValue); } var ret = customerControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoSave() { string id = TxtNoBalittanah.Text; var data = new ordersampletbl { noBalittanah = id, orderNo = TxtOrderNo.SelectedValue, sampleCode = TxtSampleCode.Text, countNumber = ParseInt(TxtCountNumber.Text), sampleDescription = TxtDescription.Text, samplingDate = Formater.ToDate(TxtSamplingDate.Text), village = TxtVillage.Text, subDistrict = TxtSubDistrict.Text, district = TxtDistrict.Text, province = TxtProvince.Text, longitude = TxtGps.Text, landUse = TxtLandUSe.SelectedValue, isReceived = TxtIsReceived.SelectedValue, creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = sampleControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoUpdate() { int id = ParseInt(TxtEmployeeNo.Text); var data = new employeetbl { employeeNo = id, employeeName = TxtEmployeeName.Text, position = TxtPosition.Text, employeeEmail = TxtEmpEmail.Text, derivativeToEmployee = ParseInt(TxtDerivativeEmp.SelectedValue), modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; if (TxtAccountNo.SelectedValue != "-1") { data.accountNo = ParseInt(TxtAccountNo.SelectedValue); } var ret = employeeControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoUpdate() { int id = ParseInt(TxtCustomerNo.Text); var data = new customertbl { customerNo = id, customerName = TxtCustomerName.Text, customerEmail = TxtCusEmail.Text, companyName = TxtCompanyName.Text, companyAddress = TxtCompanyAddress.Text, companyPhone = TxtPhoneNo.Text, companyEmail = TxtComEmail.Text, modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; if (TxtAccountNo.SelectedValue != "-1") { data.accountNo = ParseInt(TxtAccountNo.SelectedValue); } var ret = customerControl.UpdateData(id.ToString(), data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
private void DoSave() { string pwd = Crypto.Encrypt(TxtPassword.Text); var data = new accounttbl { username = TxtUsername.Text, password = pwd, roleName = TxtRoleName.SelectedValue, isEmailVerified = "0", creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = accountControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoDuplicate(string NoBalitTanah) { var sampel = DataSampel.Where(x => x.noBalittanah == NoBalitTanah).FirstOrDefault(); if (sampel != null) { DataTable table = new DataTable(); table.Columns.Add("countNumber", typeof(int)); table.Columns.Add("sampleCode", typeof(string)); table.Columns.Add("noBalittanah", typeof(string)); table.Columns.Add("village", typeof(string)); table.Columns.Add("subDistrict", typeof(string)); table.Columns.Add("district", typeof(string)); table.Columns.Add("province", typeof(string)); table.Columns.Add("landUse", typeof(string)); table.Columns.Add("longitude", typeof(string)); table.Columns.Add("latitude", typeof(string)); DataSampel.Add(new ordersampletbl { orderNo = sampel.orderNo, countNumber = DataSampel.Count + 1, sampleCode = "SAMPLE/" + shortid.ShortId.Generate(true, false, 10), noBalittanah = GenerateNoBalitTanah(DataSampel.Count + 1), village = sampel.village, subDistrict = sampel.subDistrict, district = sampel.district, province = sampel.province, landUse = sampel.landUse, longitude = sampel.longitude, latitude = sampel.latitude, creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow(), modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() , samplingDate = sampel.samplingDate, sampleDescription = sampel.sampleDescription }); if (DataSampel.Count > 0) { var sort = DataSampel.OrderBy(o => o.countNumber); DataSampel = sort.ToList(); foreach (var data in DataSampel) { table.Rows.Add(data.countNumber, data.sampleCode, data.noBalittanah, data.village, data.subDistrict, data.district, data.province, data.landUse, data.longitude, data.latitude); } } LitJumlahSampel.Text = DataSampel.Count.ToString(); GvData.DataSource = table; GvData.DataBind(); UpdateJumlahContoh(); } }
private void LoadPage() { GenerateAnalisis(); GenerateKomoditas(); GenerateSampleType(); LoadDataGrid(); txtTanggalTerima.Text = DatetimeHelper.GetDatetimeNow().ToString("yyyy-MM-dd"); }
private void DoUpdate() { string id = TxtOrderNo.Text; var data = new ordermastertbl { orderNo = TxtOrderNo.Text, customerNo = Convert.ToInt32(DDLCustomerno.SelectedValue), comodityNo = Convert.ToInt32(DDLComodityNo.SelectedValue), sampleTotal = Convert.ToInt32(TxtTotalSample.Text), priceTotal = Convert.ToInt32(TxtPriceTotal.Text), status = TxtStatus.Text, paymentType = TxtTipePayment.Text, isPayed = DDLPayed.SelectedValue, isPayedDate = Convert.ToDateTime(TxtPayedDate.Text), isAppr = TxtAppr.Text, pic = Convert.ToInt32(DDLPIC.SelectedValue), modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; if (DDLCustomerno.SelectedValue != "-1") { data.customerNo = ParseInt(DDLCustomerno.SelectedValue); } else if (DDLComodityNo.SelectedValue != "-1") { data.comodityNo = ParseInt(DDLComodityNo.SelectedValue); } //else if(DDLPayed.SelectedValue != "-1") //{ // data.isPayed = DDLPayed.SelectedValue; //} else if (DDLPIC.SelectedValue != "-1") { data.pic = ParseInt(DDLPIC.SelectedValue); } var ret = daftarspControl.UpdateData(id, data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }
string GenerateNoOrder(long LastNumber = -1) { if (LastNumber <= 0) { var curDate = DatetimeHelper.GetDatetimeNow(); string FormatNo = $"{(CounterGen.GetLastNumber("BALITTANAH") + 1).ToString("0000")}/LP Balittanah/{curDate.ToString("MM")}/{curDate.ToString("yyyy")}"; return(FormatNo); } else { var curDate = DatetimeHelper.GetDatetimeNow(); string FormatNo = $"{(LastNumber).ToString("0000")}/LP Balittanah/{curDate.ToString("MM")}/{curDate.ToString("yyyy")}"; return(FormatNo); } }
string GenerateNoBatch(long LastNumber = -1) { if (LastNumber <= 0) { var curDate = DatetimeHelper.GetDatetimeNow(); string FormatNo = $"B-{(CounterGen.GetLastNumber("BATCHNO") + 1).ToString("00000")}/{curDate.ToString("MM")}/{curDate.ToString("yyyy")}"; return(FormatNo); } else { var curDate = DatetimeHelper.GetDatetimeNow(); string FormatNo = $"B-{LastNumber.ToString("00000")}/{curDate.ToString("MM")}/{curDate.ToString("yyyy")}"; return(FormatNo); } }
private void LoadPage() { TxtTanggalDiterima.Text = DatetimeHelper.GetDatetimeNow().ToString("yyyy-MM-dd"); CmbPropinsi.DataSource = location.GetPropinsi(); CmbPropinsi.DataTextField = "Nama"; CmbPropinsi.DataValueField = "Key"; CmbPropinsi.DataBind(); CmbPropinsi.SelectedIndex = 0; LoadKabupaten(); LoadKecamatan(); LoadDesa(); GenerateAnalisis(); GenerateKomoditas(); LoadDataGrid(); }
string GenerateNoBalitTanah(long SampelCounter, long OrderLastNumber = -1) { if (OrderLastNumber <= 0) { var curDate = DatetimeHelper.GetDatetimeNow(); string FormatNo = $"{curDate.ToString("yy")}.{curDate.ToString("MM")}.{CounterGen.GetLastNumber("BALITTANAH") + 1} K.P. {CounterGen.GetLastNumber("SAMPEL") + SampelCounter}"; //$"{CounterGen.GetLastNumber("SAMPEL") + SampelCounter}/PRM/POG/{curDate.ToString("MM")}/{curDate.ToString("yyyy")}"; return(FormatNo); } else { var curDate = DatetimeHelper.GetDatetimeNow(); string FormatNo = $"{curDate.ToString("yy")}.{curDate.ToString("MM")}.{OrderLastNumber} K.P. {SampelCounter}"; //$"{CounterGen.GetLastNumber("SAMPEL") + SampelCounter}/PRM/POG/{curDate.ToString("MM")}/{curDate.ToString("yyyy")}"; return(FormatNo); } }
private void DoUpdate() { try { string idd = TxtDetailNo.Text.ToString(); int id = ParseInt(TxtorderNo.Text); var det = ordtl.DetailData(idd); var wholedata = det.Result; var updatests = GetStatus(idd.ToString()); var data = new orderanalysisdetailtbl { orderDetailNo = wholedata.orderDetailNo, orderNo = wholedata.orderNo, sampleNo = wholedata.sampleNo, elementId = wholedata.elementId, parametersNo = wholedata.parametersNo, elementValue = wholedata.elementValue, status = updatests, pic = wholedata.pic, creaBy = wholedata.creaBy, creaDate = wholedata.creaDate, modBy = wholedata.modBy, modDate = DatetimeHelper.GetDatetimeNow() }; var ret = ordtl.UpdateData(idd.ToString(), data); if (ret.Result) { Alert("Tugas Telah Diambil"); } else { Alert("Terjadi Kesalahan, Gagal mengambil tugas"); } } catch (Exception er) { System.Diagnostics.Debug.WriteLine(er); } }
private void DoSave() { var data = new standarddetailtbl { stdId = ParseInt(TxtStdId.SelectedValue), elementId = Convert.ToInt32(TxtElementCode.SelectedValue), creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = standardDetailControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoSave() { var data = new analysistypetbl { analysisTypeName = this.TxtAnalysisTypeName.Text, description = this.TxtDescription.Text, creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = analysisControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoSave() { var data = new comoditytbl { comodityName = TxtComodityName.Text, derivativeTo = ParseInt(TxtDerivativeTo.SelectedValue), description = TxtDescription.Text, creaBy = currentUser, creaDate = DatetimeHelper.GetDatetimeNow() }; var ret = comodityControl.AddData(data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("data berhasil disimpan"); } else { Alert("Gagal menyimpan data"); } }
private void DoUpdate() { string id = TxtRoleName.Text; var data = new roletbl { roleName = id, description = TxtDescription.Text, modBy = currentUser, modDate = DatetimeHelper.GetDatetimeNow() }; var ret = roleControl.UpdateData(id, data); if (ret.Result) { ClearFields(); SetLayout(ModeForm.ViewData); Alert("Data berhasil diubah"); } else { Alert("Gagal mengubah data"); } }