protected void txtSort_TextChanged(object sender, EventArgs e) { bool check = SqlHelper.CheckAccess(EventName.ListofEvents.ChangeSortDetailAssignProperty.ToString(), IDUser); if (!check) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> شما به این رویداد اجازه دسترسی ندارید!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); return; } GridViewRow row = ((GridViewRow)((TextBox)sender).NamingContainer); int index = row.RowIndex; TextBox txtSort = (TextBox)grdDetailAssignProperty.Rows[index].FindControl("txtSort"); HiddenField hfIDDetailAssignPropertyInGrid = (HiddenField)grdDetailAssignProperty.Rows[index].FindControl("hfIDDetailAssignPropertyInGrid"); ViewModel.tblDetailAssignProperty updateBySort = new ViewModel.tblDetailAssignProperty(); updateBySort.IDDetailAssignProperty = hfIDDetailAssignPropertyInGrid.Value.StringToGuid(); updateBySort.Sort = txtSort.Text.StringToInt(); bool ret = BisDetailAssignProperty.UpdateDetailAssignProperty(updateBySort); if (ret) { fillGrdDetailAssignProperty(hfIDRet.Value); } else { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در ثبت اطلاعات!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); } }
protected void grdDetailAssignProperty_RowCommand(object sender, GridViewCommandEventArgs e) { Guid IDDetailAssignProperty = e.CommandArgument.ToString().StringToGuid(); switch (e.CommandName) { case "Delete": try { bool check = SqlHelper.CheckAccess(EventName.ListofEvents.DeleteDetailAssignProperty.ToString(), IDUser); if (!check) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> شما به این رویداد اجازه دسترسی ندارید!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); return; } ViewModel.tblDetailAssignProperty deleteDetailAssignProperty = new ViewModel.tblDetailAssignProperty(); deleteDetailAssignProperty.IDDetailAssignProperty = IDDetailAssignProperty; bool ret = BisDetailAssignProperty.DeleteDetailAssignProperty(deleteDetailAssignProperty); if (ret) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اطلاعات با موفقیت حذف شد!</p>\",title: \"<p style='text-align:right;direction:rtl'>حذف اطلاعات</p>\"});", true); fillGrdDetailAssignProperty(hfIDRet.Value); } else { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در حذف اطلاعات!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); } } catch { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در برقراری ارتباط با دیتابیس!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); } break; case "SetForShowInPorductCategory": try { ViewModel.tblDetailAssignProperty SetForShowInPorductCategory = new ViewModel.tblDetailAssignProperty(); SetForShowInPorductCategory.IDDetailAssignProperty = IDDetailAssignProperty; SetForShowInPorductCategory.IDRet = hfIDRet.Value.StringToGuid(); bool retUpdate = BisDetailAssignProperty.SetForShowInPorductCategory(SetForShowInPorductCategory); if (retUpdate) { fillGrdDetailAssignProperty(hfIDRet.Value); } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorMessage", "alert('اشکال در ثبت Under Spot');", true); } } catch { } break; } }
protected void TreeDropDownProperties_tvDropDown_SelectedNode(object sender, EventArgs e) { try { bool check = SqlHelper.CheckAccess(EventName.ListofEvents.AddDetailAssignProperty.ToString(), IDUser); if (!check) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> شما به این رویداد اجازه دسترسی ندارید!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); return; } TreeNode SelectedNode = sender as TreeNode; if (SelectedNode.ChildNodes.Count != 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> شما تنها مجاز به انتخاب شاخه های نهایی این درخت هستید!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); return; } ViewModel.Search getAssignProperty = new ViewModel.Search(); getAssignProperty.Filter = " and tblDetailAssignProperty.IDRet = '" + hfIDRet.Value + "' and tblDetailAssignProperty.IDProperty='" + TreeDropDownProperties.SelectedNode() + "'"; DataSet dsAssign = BisDetailAssignProperty.GetDetailAssignPropertyData(getAssignProperty); if (dsAssign.Null_Ds()) { ViewModel.tblDetailAssignProperty NewDetailAssignProperty = new ViewModel.tblDetailAssignProperty(); NewDetailAssignProperty.IDDetailAssignProperty = Guid.NewGuid(); NewDetailAssignProperty.IDProperty = TreeDropDownProperties.SelectedNode().StringToGuid(); NewDetailAssignProperty.IDRet = hfIDRet.Value.StringToGuid(); NewDetailAssignProperty.Sort = 0; bool resault = BisDetailAssignProperty.AddDetailAssignProperty(NewDetailAssignProperty); if (resault) { fillGrdDetailAssignProperty(hfIDRet.Value); } else { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در ثبت اطلاعات!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); } } else { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> ویژگی انتخاب شده برای این گروه تکراری است!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); } } catch { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در برقراری ارتباط با دیتابیس!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true); } }